Skip to content

Commit

Permalink
verilog: skip compiler directives in enum definition (universal-ctags…
Browse files Browse the repository at this point in the history
…#4056)

Signed-off-by: Hiroo HAYASHI <[email protected]>
  • Loading branch information
hirooih committed Aug 24, 2024
1 parent e8578f4 commit adcc121
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--sort=no
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
my_enum input.sv /^} my_enum;$/;" T
OTHER_VAL1 input.sv /^ OTHER_VAL1,$/;" c typedef:my_enum
OTHER_VAL2 input.sv /^ OTHER_VAL2$/;" c typedef:my_enum
e input.sv /^my_enum e;$/;" r
10 changes: 10 additions & 0 deletions Units/parser-verilog.r/systemverilog-github4056.d/input.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// https://github.com/universal-ctags/ctags/issues/4056

typedef enum {
`include "test1.txt"
OTHER_VAL1,
`include "test2.txt"
OTHER_VAL2
} my_enum;

my_enum e;
1 change: 1 addition & 0 deletions parsers/verilog.c
Original file line number Diff line number Diff line change
Expand Up @@ -1614,6 +1614,7 @@ static int pushEnumNames (tokenInfo* token, int c)
c = skipWhite (vGetc ());
while (c != '}' && c != EOF)
{
c = skipMacro (c, token);
if (!isWordToken (c))
{
VERBOSE ("Unexpected input: %c\n", c);
Expand Down

0 comments on commit adcc121

Please sign in to comment.