Fix lexing of "defined" as an operator, not an identifier.

Simply need to move the rule for IDENTIFIER to be after "defined" and
everything is happy.

With this change, tests 50 through 53 all pass now.
This commit is contained in:
Carl Worth 2010-05-26 09:35:34 -07:00
parent f6914fd37b
commit 16c1e980e2
2 changed files with 5 additions and 7 deletions

View file

@ -102,12 +102,6 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
return INTEGER;
}
{IDENTIFIER} {
yylval.str = xtalloc_strdup (yyextra, yytext);
return IDENTIFIER;
}
"<<" {
return LEFT_SHIFT;
}
@ -148,6 +142,11 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
return DEFINED;
}
{IDENTIFIER} {
yylval.str = xtalloc_strdup (yyextra, yytext);
return IDENTIFIER;
}
{PUNCTUATION} {
return yytext[0];
}

View file

@ -13,4 +13,3 @@ failure_3
#else
success_3
#endif