Skip to content

Commit c5190af

Browse files
committed
Verilog: allow whitespace between macro and arguments
Verilog allows whitespace between the macro identifier and the parentheses.
1 parent d3071f4 commit c5190af

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

regression/verilog/preprocessor/define1.desc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ value
1313

1414
x-y-z
1515
x-y-value
16+
moo-foo-bar
1617
^EXIT=0$
1718
^SIGNAL=0$
1819
--

regression/verilog/preprocessor/define1.v

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
`define with_parameter(a, b, c) a-b-c
88
`with_parameter(x, y, z)
99
`with_parameter(x, y, `with_value)
10+
`with_parameter (moo, foo, bar)

src/verilog/verilog_preprocessor.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,9 @@ auto verilog_preprocessort::parse_define_arguments(const definet &define)
277277
if(define.parameters.empty())
278278
return {};
279279

280+
// skip whitespace
281+
tokenizer().skip_ws();
282+
280283
if(tokenizer().next_token() != '(')
281284
throw verilog_preprocessor_errort() << "expecting define arguments";
282285

0 commit comments

Comments
 (0)