Skip to content

Commit

Permalink
Merge pull request #993 from ithinuel/escape-in-attribute
Browse files Browse the repository at this point in the history
add double quote escapes from pragma comments.
  • Loading branch information
caryr authored Sep 4, 2023
2 parents e92caa0 + 873c2fe commit d938654
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions ivlpp/lexor.lex
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ keywords (line|include|define|undef|ifdef|ifndef|else|elsif|endif)
<PCOMENT>`[a-zA-Z][a-zA-Z0-9_$]* {
if (macro_needs_args(yytext+1)) yy_push_state(MA_START); else do_expand(0);
}
<PCOMENT>`\" { fputc('\"', yyout); }

/* Strings do not contain preprocessor directives or macro expansions.
*/
Expand Down
4 changes: 4 additions & 0 deletions ivtest/ivltests/attrib_expr.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d938654

Please sign in to comment.