tolerate escaped vendor comments within macros

This commit is contained in:
Zachary Snow 2021-08-16 18:22:04 -06:00
parent 581a7911de
commit c17d859988
3 changed files with 12 additions and 0 deletions

View File

@ -546,6 +546,10 @@ preprocessInput = do
'/' : '*' : _ -> removeThrough "*/"
'`' : '"' : _ -> handleBacktickString
'"' : _ -> handleString
'/' : '`' : '`' : '*' : _ ->
if null macroStack
then consume
else removeThrough "*``/"
'`' : '`' : _ -> do
if null macroStack
then do

View File

@ -0,0 +1,4 @@
// pattern: Parse error
module top;
/``* some awful garbage *``/
endmodule

View File

@ -0,0 +1,4 @@
`define YUCK /``* some awful garbage *``/
module top;
`YUCK
endmodule