summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2014-07-01 17:58:37 -0700
committerCarl Worth <cworth@cworth.org>2014-08-06 17:37:31 -0700
commit327a1840ae5c47c337e3323e7e13ddf279bec9e9 (patch)
tree9fd06c8d03c78db99c88b8e5a84b76b1ff46de94
parent1ca0556e37e587eab6c029b5d07bb1a42681f116 (diff)
glsl/glcpp: Fix NULL directives when followed by a single-line comment
This is the fix for the following line: # // comment to ignore here According to the translation-phase rules, the comment should be removed before the preprocessor looks to interpret the null directive. So in our implementation we must explicitly look for single-line comments in the <HASH> start condition as well. This commit fixes the following Khronos GLES3 CTS tests: null_directive_vertex null_directive_fragment
-rw-r--r--src/glsl/glcpp/glcpp-lex.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l
index 2cfe203dac..2b92fd37e2 100644
--- a/src/glsl/glcpp/glcpp-lex.l
+++ b/src/glsl/glcpp/glcpp-lex.l
@@ -250,7 +250,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
}
/* Single-line comments */
-<INITIAL,DEFINE>"//"[^\r\n]* {
+<INITIAL,DEFINE,HASH>"//"[^\r\n]* {
}
/* Multi-line comments */