Complete valid tokens in "shift" status.

This commit is contained in:
Stefano Sanfilippo 2014-11-23 23:14:43 +01:00
parent 43fee532b0
commit 0f76a9da53

View File

@ -17,7 +17,7 @@ CHAR [a-zA-Z_]
%x shift %x shift
%% %%
("\r\n"|"\n") { <INITIAL,shift>("\r\n"|"\n") {
lineNumber += 1; lineNumber += 1;
} }
@ -153,7 +153,7 @@ CHAR [a-zA-Z_]
return CASE_END; return CASE_END;
} }
[ \t\f\v] {} <INITIAL,shift>[ \t\f\v] {}
{CHAR}({DIGIT}|{CHAR})* { {CHAR}({DIGIT}|{CHAR})* {
yylval.strval = strdup(yytext); yylval.strval = strdup(yytext);
@ -165,7 +165,7 @@ CHAR [a-zA-Z_]
return NUMBER; return NUMBER;
} }
. { <INITIAL,shift>. {
yyerror("Unexpected token"); yyerror("Unexpected token");
return -1; return -1;
}; };