From 77260fc0a04c72c98389adeb7244467e10ef2979 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 17 Jun 2010 14:36:34 -0700 Subject: glcpp: Actually support #ifdef and #ifndef. Strangely, the lexer never created these tokens, even though the parser already had code to handle them. --- glcpp/glcpp-lex.l | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'glcpp') diff --git a/glcpp/glcpp-lex.l b/glcpp/glcpp-lex.l index 06bde3f195..a04e0fabdf 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; -- cgit v1.2.3