summaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp/glcpp-lex.l
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2010-07-02 15:31:26 -0700
committerKenneth Graunke <[email protected]>2010-07-02 18:03:58 -0700
commit7e908a6a27f196027a4dfd0f4d8c37aa71e163fa (patch)
tree3025561eab902a7b29d58311d167bbe24ea8d35d /src/glsl/glcpp/glcpp-lex.l
parent2070f9f5bec99e7b91309060984431aa7ea32c00 (diff)
glcpp: Add #error support.
Diffstat (limited to 'src/glsl/glcpp/glcpp-lex.l')
-rw-r--r--src/glsl/glcpp/glcpp-lex.l8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l
index afddd7ddb32..6a91b09954a 100644
--- a/src/glsl/glcpp/glcpp-lex.l
+++ b/src/glsl/glcpp/glcpp-lex.l
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <string.h>
+#include <ctype.h>
#include "glcpp.h"
#include "glcpp-parse.h"
@@ -139,6 +140,13 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
}
}
+{HASH}error.* {
+ char *p;
+ for (p = yytext; !isalpha(p[0]); p++); /* skip " # " */
+ p += 5; /* skip "error" */
+ glcpp_error(yylloc, yyextra, "#error%s", p);
+}
+
{HASH}define{HSPACE}+/{IDENTIFIER}"(" {
yyextra->space_tokens = 0;
return HASH_DEFINE_FUNC;