3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-20 03:12:05 +00:00

verilog: fix string literal regular expression (#5187)

* verilog: fix string literal regular expression.

A backslash was improperly quoted, causing string literal matching
to fail when the final token before a closing quote was an escaped
backslash.

* verilog: add regression test for string literal regex bug.

Test for bug triggered by escaped backslash immediately before
closing quote (introduced in ca7d94af and fixed by 40aa7eaf).
This commit is contained in:
garytwong 2025-06-19 16:41:18 +00:00 committed by Emil J. Tywoniak
parent e690fb59f1
commit a519390fc4
2 changed files with 6 additions and 1 deletions

View file

@ -371,7 +371,7 @@ TIME_SCALE_SUFFIX [munpf]?s
}
\" { BEGIN(STRING); }
<STRING>([^\"]|\\.)+ { yymore(); }
<STRING>([^\\"]|\\.)+ { yymore(); }
<STRING>\" {
BEGIN(0);
char *yystr = strdup(YYText());