summaryrefslogtreecommitdiffstats
path: root/glcpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2010-06-17 14:36:34 -0700
committerKenneth Graunke <[email protected]>2010-06-21 11:31:55 -0700
commit77260fc0a04c72c98389adeb7244467e10ef2979 (patch)
tree62782e0a263d1b459439f84152d1a6230992d396 /glcpp
parente0e429fca3f1f67e5d18f0989fd2dcc0d23a6bb9 (diff)
glcpp: Actually support #ifdef and #ifndef.
Strangely, the lexer never created these tokens, even though the parser already had code to handle them.
Diffstat (limited to 'glcpp')
-rw-r--r--glcpp/glcpp-lex.l10
1 files changed, 10 insertions, 0 deletions
diff --git a/glcpp/glcpp-lex.l b/glcpp/glcpp-lex.l
index 06bde3f1957..a04e0fabdf8 100644
--- a/glcpp/glcpp-lex.l
+++ b/glcpp/glcpp-lex.l
@@ -70,6 +70,16 @@ NON_STARS_THEN_STARS [^*]*[*]+
return OTHER;
}
+{HASH}ifdef/.*\n {
+ yyextra->space_tokens = 0;
+ return HASH_IFDEF;
+}
+
+{HASH}ifndef/.*\n {
+ yyextra->space_tokens = 0;
+ return HASH_IFNDEF;
+}
+
{HASH}if/.*\n {
yyextra->lexing_if = 1;
yyextra->space_tokens = 0;