summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-02-05 08:28:14 +0100
committerKaz Kylheku <kaz@kylheku.com>2012-02-05 08:28:14 +0100
commita51d9c18b071f7c3cb624771ecc21c3a9a464640 (patch)
tree1052bd0814668427071323113375d0c19c05727f /parser.l
parent4c6802f7284e17b7cbc1f178f90775182d379be6 (diff)
downloadtxr-a51d9c18b071f7c3cb624771ecc21c3a9a464640.tar.gz
txr-a51d9c18b071f7c3cb624771ecc21c3a9a464640.tar.bz2
txr-a51d9c18b071f7c3cb624771ecc21c3a9a464640.zip
* parser.l: Allow semicolon terminator on hex and octal
escapes in a regex. Removed o escape character from octal constants in strings and quasiliterals: no such thing is documented. Octal constants can be semicolon-terminated like hex ones. * txr.1: Documented semicolons after octal constants in string literals and after hex and octal constants in regexes.
Diffstat (limited to 'parser.l')
-rw-r--r--parser.l4
1 files changed, 2 insertions, 2 deletions
diff --git a/parser.l b/parser.l
index 63f6291c..10328440 100644
--- a/parser.l
+++ b/parser.l
@@ -494,7 +494,7 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
return REGCHAR;
}
-<REGEX>[\\](x{HEX}+|{OCT}+) {
+<REGEX>[\\](x{HEX}+|{OCT}+);? {
yylval.chr = num_esc(yytext + 1);
return REGCHAR;
}
@@ -595,7 +595,7 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
lineno++;
}
-<STRLIT,QSILIT>[\\](x{HEX}+;?|o{OCT}+) {
+<STRLIT,QSILIT>[\\](x{HEX}+|{OCT}+);? {
yylval.chr = num_esc(yytext+1);
return LITCHAR;
}