diff --git a/ivlpp/lexor.lex b/ivlpp/lexor.lex index 5e6cdb82a..07b0a4b0b 100644 --- a/ivlpp/lexor.lex +++ b/ivlpp/lexor.lex @@ -268,6 +268,7 @@ keywords (line|include|define|undef|ifdef|ifndef|else|elsif|endif) `[a-zA-Z][a-zA-Z0-9_$]* { if (macro_needs_args(yytext+1)) yy_push_state(MA_START); else do_expand(0); } +`\" { fputc('\"', yyout); } /* Strings do not contain preprocessor directives or macro expansions. */ diff --git a/ivtest/ivltests/attrib_expr.v b/ivtest/ivltests/attrib_expr.v index 8f6c1d636..537d5bc5c 100644 --- a/ivtest/ivltests/attrib_expr.v +++ b/ivtest/ivltests/attrib_expr.v @@ -74,6 +74,10 @@ endfunction (* attr = fn(10) *) reg attr46; +// Macro escaped +`define A_MACRO(arg) (* attr = `"arg`" *) + `A_MACRO(test) reg attr47; + initial begin $display("PASSED"); end