Skip to content

Commit adcc121

Browse files
committed
verilog: skip compiler directives in enum definition (#4056)
Signed-off-by: Hiroo HAYASHI <24754036+hirooih@users.noreply.github.com>
1 parent e8578f4 commit adcc121

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--sort=no
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
my_enum input.sv /^} my_enum;$/;" T
2+
OTHER_VAL1 input.sv /^ OTHER_VAL1,$/;" c typedef:my_enum
3+
OTHER_VAL2 input.sv /^ OTHER_VAL2$/;" c typedef:my_enum
4+
e input.sv /^my_enum e;$/;" r
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// https://github.com/universal-ctags/ctags/issues/4056
2+
3+
typedef enum {
4+
`include "test1.txt"
5+
OTHER_VAL1,
6+
`include "test2.txt"
7+
OTHER_VAL2
8+
} my_enum;
9+
10+
my_enum e;

parsers/verilog.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,6 +1614,7 @@ static int pushEnumNames (tokenInfo* token, int c)
16141614
c = skipWhite (vGetc ());
16151615
while (c != '}' && c != EOF)
16161616
{
1617+
c = skipMacro (c, token);
16171618
if (!isWordToken (c))
16181619
{
16191620
VERBOSE ("Unexpected input: %c\n", c);

0 commit comments

Comments
 (0)