From f8b1782dba2462403f1df62ecd1f8d94068ece4e Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 22 Apr 2012 21:24:28 +0000 Subject: add character constants --- lexer.l | 9 +++++++-- 1 file 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); [^\"]+ { - yylval.sval = strdup(yytext); - return QSTRING; + if (strlen(yytext) == 1) { + yylval.ival = *yytext; + return NUMBER; + } else { + yylval.sval = strdup(yytext); + return QSTRING; + } } "\"" BEGIN(INITIAL); -- cgit v1.2.3