From 435a104dd5bc12c19e65001f2e8540eb30f1c4eb Mon Sep 17 00:00:00 2001 From: Teddy Date: Tue, 25 Mar 2014 05:26:09 +0800 Subject: lexical bugs --- cibic.l | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cibic.l') diff --git a/cibic.l b/cibic.l index 26fca1f..cd9b6eb 100644 --- a/cibic.l +++ b/cibic.l @@ -64,12 +64,12 @@ digit [0-9] return INT_CONST; } -'([^\'\\]|\\.)' { +'([^\'\\]|\\.|\\[0-7][0-7]?[0-7]?|\\[xX][0-9a-fA-F]+)' { yylval.strval = strdup(yytext); return CHAR_CONST; } -\"[^\n\"]*\" { +\"[^\n\"]*\" { yylval.strval = strndup(yytext + 1, strlen(yytext) - 2); return STR_CONST; } @@ -79,6 +79,7 @@ digit [0-9] "==" { return OPT_EQ; } "!=" { return OPT_NE; } "<=" { return OPT_LE; } +">=" { return OPT_GE; } "<<" { return OPT_SHL; } ">>" { return OPT_SHR; } "++" { return OPT_INC; } -- cgit v1.2.3