From 3b73ea36c4bda1353aa0315234233fc6fd6a28bd Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 16 Jun 2010 12:21:17 -0700 Subject: [PATCH] glcpp: Pass #version, #extension, and #pragma directives through unchanged. Let the main compiler's lexer/parser handle them. --- glcpp/glcpp-lex.l | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/glcpp/glcpp-lex.l b/glcpp/glcpp-lex.l index f736ac4d59d..c28f2f6269e 100644 --- a/glcpp/glcpp-lex.l +++ b/glcpp/glcpp-lex.l @@ -61,6 +61,13 @@ NON_STARS_THEN_STARS [^*]*[*]+ return SPACE; } + /* glcpp doesn't handle #extension, #version, or #pragma directives. + * Simply pass them through to the main compiler's lexer/parser. */ +{HASH}(extension|version|pragma).*\n { + yylval.str = xtalloc_strdup (yyextra, yytext); + return OTHER; +} + {HASH}if/.*\n { yyextra->lexing_if = 1; yyextra->space_tokens = 0; -- 2.30.2