Skip to content

Commit

Permalink
Fix to make 'infinite' usable as symbol.
Browse files Browse the repository at this point in the history
Fixes #399

Signed-off-by: Henner Zeller <[email protected]>
  • Loading branch information
hzeller committed Mar 1, 2022
1 parent ec587c6 commit 3df8b0c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions verilog/parser/verilog.y
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,8 @@ KeywordIdentifier
/* TK_sample is in SystemVerilog coverage_event */
| TK_sample
{ $$ = move($1); }
| TK_infinite
{ $$ = move($1); }
;

/* TODO(fangism): phase this out:
Expand Down
1 change: 1 addition & 0 deletions verilog/parser/verilog_parser_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1799,6 +1799,7 @@ static const ParserTestCaseArray kModuleTests = {
"module m(wire p_pkg::foo_t foo); endmodule\n",
"module m; wire p_pkg::foo_t [2:0] foo [0:1]; endmodule\n",
"module m(wire p_pkg::foo_t [2:0] foo [0:2]); endmodule\n",
"module m; wire infinite; endmodule\n", // infinite also a keyword
"interface _if; wire p_pkg::foo_t foo; endinterface\n",
"interface _if; wire p_pkg::foo_t [1:0] foo [0:1]; endinterface\n",
// system task calls
Expand Down
1 change: 1 addition & 0 deletions verilog/parser/verilog_token_classifications.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ bool IsIdentifierLike(verilog_tokentype token_type) {
case verilog_tokentype::TK_from:
case verilog_tokentype::TK_discrete:
case verilog_tokentype::TK_sample:
case verilog_tokentype::TK_infinite:
return true;
default:
break;
Expand Down

0 comments on commit 3df8b0c

Please sign in to comment.