summaryrefslogtreecommitdiff
path: root/glcpp-lex.l
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-05-13 07:38:29 -0700
committerCarl Worth <cworth@cworth.org>2010-05-13 07:38:29 -0700
commit9f62a7e9e25efd79ebf46c64166876436f88f08a (patch)
tree091f1e23fd3a8b6965951c96ec4eeee578fe5a1b /glcpp-lex.l
parent8bcb6f1777ff8f763c67552c111ce8e637d78410 (diff)
Make the lexer distinguish between identifiers and defined macros.
This is just a minor style improvement for now. But the same mechanism, (having the lexer peek into the table of defined macros), will be essential when we add function-like macros in addition to the current object-like macros.
Diffstat (limited to 'glcpp-lex.l')
-rw-r--r--glcpp-lex.l5
1 files changed, 4 insertions, 1 deletions
diff --git a/glcpp-lex.l b/glcpp-lex.l
index 18d9050d71..3622db939e 100644
--- a/glcpp-lex.l
+++ b/glcpp-lex.l
@@ -53,7 +53,10 @@ TOKEN {NONSPACE}+
{IDENTIFIER} {
yylval.str = xtalloc_strdup (yyextra, yytext);
- return IDENTIFIER;
+ if (glcpp_parser_macro_defined (yyextra, yylval.str))
+ return MACRO;
+ else
+ return IDENTIFIER;
}
{TOKEN} {