summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-12-07 09:05:38 -0800
committerKaz Kylheku <kaz@kylheku.com>2011-12-07 09:05:38 -0800
commit46dea2737dcd5d74585878459999f230f2d002bc (patch)
treed944afa3d26f8a6445939770a17e83526ec332ab /parser.l
parentb3540d10efec1c3d27d0206d67635eaeb39141ec (diff)
downloadtxr-46dea2737dcd5d74585878459999f230f2d002bc.tar.gz
txr-46dea2737dcd5d74585878459999f230f2d002bc.tar.bz2
txr-46dea2737dcd5d74585878459999f230f2d002bc.zip
* parser.l: In the CHRLIT state, return a nonblank character as an
IDENT token. This allows for character literals like #\$.
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 e22c6d74..53644a03 100644
--- a/parser.l
+++ b/parser.l
@@ -585,6 +585,11 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
return IDENT;
}
+<CHRLIT>[^ \t\n] {
+ yylval.lexeme = utf8_dup_from(yytext);
+ return IDENT; /* hack */
+ }
+
<STRLIT>\n {
yyerrprepf(lit("newline in string literal"), nao);
lineno++;