From: Kenneth Graunke Date: Thu, 17 Jun 2010 21:36:34 +0000 (-0700) Subject: glcpp: Actually support #ifdef and #ifndef. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=77260fc0a04c72c98389adeb7244467e10ef2979;p=mesa.git glcpp: Actually support #ifdef and #ifndef. Strangely, the lexer never created these tokens, even though the parser already had code to handle them. --- 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;