summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--parser.l5
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 0ff4650a..4dc6b703 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2011-12-07 Kaz Kylheku <kaz@kylheku.com>
+ * parser.l: In the CHRLIT state, return a nonblank character as an
+ IDENT token. This allows for character literals like #\$.
+
+2011-12-07 Kaz Kylheku <kaz@kylheku.com>
+
* eval.c (eval_init): New character functions registered.
* lib.c (c_num): Generalized to convert characters to numbers also.
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++;