From 873c2fecd45c77467bcfebfd6daf7daf1213ffca Mon Sep 17 00:00:00 2001 From: Wilfried Chauveau Date: Thu, 10 Aug 2023 21:10:23 +0100 Subject: [PATCH] add double quote escapes from pragma comments. --- ivlpp/lexor.lex | 1 + ivtest/ivltests/attrib_expr.v | 4 ++++ 2 files changed, 5 insertions(+) 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