summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-06-16 12:21:17 -0700
committerKenneth Graunke <kenneth@whitecape.org>2010-06-21 11:31:55 -0700
commit3b73ea36c4bda1353aa0315234233fc6fd6a28bd (patch)
treeaf5f79b81dbcb858bf4f206bb9bc01b42bf17668
parent04ba86a536d76ef24c749e16c785c1634b9187c9 (diff)
glcpp: Pass #version, #extension, and #pragma directives through unchanged.
Let the main compiler's lexer/parser handle them.
-rw-r--r--glcpp/glcpp-lex.l7
1 files changed, 7 insertions, 0 deletions
diff --git a/glcpp/glcpp-lex.l b/glcpp/glcpp-lex.l
index f736ac4..c28f2f6 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;