summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-06-26 19:09:49 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-06-26 19:09:49 -0700
commitb7419ec90436c09ac5cf1b0363cdba5d7e882bfb (patch)
treebc95170d8391347ff59a9b6401c8cdee94040204 /parser.l
parentf8eb0a80d0e1b2c51461bb59aa69e83a82639081 (diff)
downloadtxr-b7419ec90436c09ac5cf1b0363cdba5d7e882bfb.tar.gz
txr-b7419ec90436c09ac5cf1b0363cdba5d7e882bfb.tar.bz2
txr-b7419ec90436c09ac5cf1b0363cdba5d7e882bfb.zip
Third round of quasiliteral-related fixes.
* parser.l (char_esc): Recognize \@ escape. (grammar): Add a rule for a \@ escape in quasiliterals, and quasi word list literals.
Diffstat (limited to 'parser.l')
-rw-r--r--parser.l6
1 files changed, 6 insertions, 0 deletions
diff --git a/parser.l b/parser.l
index 7ec31991..37bbdc70 100644
--- a/parser.l
+++ b/parser.l
@@ -142,6 +142,7 @@ static wchar_t char_esc(int letter)
case '\'': return L'\'';
case '`': return L'`';
case '/': return L'/';
+ case '@': return L'@';
case '\\': return L'\\';
}
@@ -841,6 +842,11 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
return LITCHAR;
}
+<QSILIT,QWLIT>[\\]@ {
+ yylval->chr = char_esc(yytext[1]);
+ return LITCHAR;
+}
+
<STRLIT,QSILIT,WLIT,QWLIT>{WS}[\\]\n{WS} {
yyextra->lineno++;
}