aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gisselquist <zipcpu@gmail.com>2018-05-03 12:35:01 +0200
committerClifford Wolf <clifford@clifford.at>2018-05-03 12:35:01 +0200
commite060375f23d56b4e330a946d5a626f0163499618 (patch)
tree767d2b556d418b5c9282023381948c26e5d164a9
parentea3ff6f59c9d406d67bc97cb7a8a884c60028275 (diff)
downloadyosys-e060375f23d56b4e330a946d5a626f0163499618.tar.gz
yosys-e060375f23d56b4e330a946d5a626f0163499618.tar.bz2
yosys-e060375f23d56b4e330a946d5a626f0163499618.zip
Support more character literals
-rw-r--r--frontends/verilog/verilog_lexer.l10
1 files changed, 9 insertions, 1 deletions
diff --git a/frontends/verilog/verilog_lexer.l b/frontends/verilog/verilog_lexer.l
index 32d7738cf..d12c9ee4e 100644
--- a/frontends/verilog/verilog_lexer.l
+++ b/frontends/verilog/verilog_lexer.l
@@ -241,10 +241,18 @@ YOSYS_NAMESPACE_END
while (yystr[i]) {
if (yystr[i] == '\\' && yystr[i + 1]) {
i++;
- if (yystr[i] == 'n')
+ if (yystr[i] == 'a')
+ yystr[i] = '\a';
+ else if (yystr[i] == 'f')
+ yystr[i] = '\f';
+ else if (yystr[i] == 'n')
yystr[i] = '\n';
+ else if (yystr[i] == 'r')
+ yystr[i] = '\r';
else if (yystr[i] == 't')
yystr[i] = '\t';
+ else if (yystr[i] == 'v')
+ yystr[i] = '\v';
else if ('0' <= yystr[i] && yystr[i] <= '7') {
yystr[i] = yystr[i] - '0';
if ('0' <= yystr[i + 1] && yystr[i + 1] <= '7') {