From: Carl Worth Date: Wed, 26 May 2010 16:35:34 +0000 (-0700) Subject: Fix lexing of "defined" as an operator, not an identifier. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=16c1e980e2e3c8852ce9bea85afe094c24e420fa;p=mesa.git 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. --- diff --git a/glcpp-lex.l b/glcpp-lex.l index 97f01d06368..d6b7726d36d 100644 --- a/glcpp-lex.l +++ b/glcpp-lex.l @@ -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]; } diff --git a/tests/053-if-divide-and-shift.c b/tests/053-if-divide-and-shift.c index ddc1573ab26..d24c54a88d1 100644 --- a/tests/053-if-divide-and-shift.c +++ b/tests/053-if-divide-and-shift.c @@ -13,4 +13,3 @@ failure_3 #else success_3 #endif -