aboutsummaryrefslogtreecommitdiff
path: root/lexer.l
diff options
context:
space:
mode:
Diffstat (limited to 'lexer.l')
-rw-r--r--lexer.l9
1 files changed, 7 insertions, 2 deletions
diff --git a/lexer.l b/lexer.l
index f157edf..fe0f809 100644
--- a/lexer.l
+++ b/lexer.l
@@ -95,8 +95,13 @@ DEC [0-9]+
"\"" BEGIN(QUOTED);
<QUOTED>[^\"]+ {
- yylval.sval = strdup(yytext);
- return QSTRING;
+ if (strlen(yytext) == 1) {
+ yylval.ival = *yytext;
+ return NUMBER;
+ } else {
+ yylval.sval = strdup(yytext);
+ return QSTRING;
+ }
}
<QUOTED>"\"" BEGIN(INITIAL);