summaryrefslogtreecommitdiff
path: root/glcpp-lex.l
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-05-26 09:35:34 -0700
committerCarl Worth <cworth@cworth.org>2010-05-26 09:37:14 -0700
commit16c1e980e2e3c8852ce9bea85afe094c24e420fa (patch)
treeb358b1fb120a5d802b97b7d323514531054d1636 /glcpp-lex.l
parentf6914fd37b2b66d7be1ba0c31450d89d1785ccce (diff)
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.
Diffstat (limited to 'glcpp-lex.l')
-rw-r--r--glcpp-lex.l11
1 files changed, 5 insertions, 6 deletions
diff --git a/glcpp-lex.l b/glcpp-lex.l
index 97f01d0636..d6b7726d36 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];
}