summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-01-27 22:55:14 -0800
committerKaz Kylheku <kaz@kylheku.com>2012-01-27 22:55:14 -0800
commitcdc64fd7a30d68dbd930ded963a804089821d08e (patch)
treef1aef2ba7ffa512537cec183745398494662dcca /parser.l
parent076313321ca0d780cfedd06ca3faa8e192cab130 (diff)
downloadtxr-cdc64fd7a30d68dbd930ded963a804089821d08e.tar.gz
txr-cdc64fd7a30d68dbd930ded963a804089821d08e.tar.bz2
txr-cdc64fd7a30d68dbd930ded963a804089821d08e.zip
* parser.l: Support hex and octal escapes in string and quasiliterals,
as the documentation says. Also support an optional trailing ; delimiter in hex escapes. * txr.1: Documented.
Diffstat (limited to 'parser.l')
-rw-r--r--parser.l5
1 files changed, 5 insertions, 0 deletions
diff --git a/parser.l b/parser.l
index d9883e6c..5ef544e1 100644
--- a/parser.l
+++ b/parser.l
@@ -584,6 +584,11 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
lineno++;
}
+<STRLIT,QSILIT>[\\](x{HEX}+;?|o{OCT}+) {
+ yylval.chr = num_esc(yytext+1);
+ return LITCHAR;
+ }
+
<CHRLIT>(x{HEX}+|o{OCT}+) {
yylval.chr = num_esc(yytext);
return LITCHAR;