diff options
author | Carl Worth <cworth@cworth.org> | 2010-07-20 13:16:17 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-07-20 14:30:48 -0700 |
commit | 0be520acf2309d7c4eff3e064b5d74749950a68d (patch) | |
tree | b5e7cd1f47b10ece0d35cbb2a22f19bb4d5f3035 | |
parent | a2a6e63e6fd0d1feb2af7af79404860ab92c47de (diff) |
glcpp: Support #if(expression) with no intervening space.
And add a test case to ensure that this works.
-rw-r--r-- | src/glsl/glcpp/glcpp-lex.l | 2 | ||||
-rw-r--r-- | src/glsl/glcpp/tests/066-if-nospace-expression.c | 3 | ||||
-rw-r--r-- | src/glsl/glcpp/tests/066-if-nospace-expression.c.expected | 4 |
3 files changed, 8 insertions, 1 deletions
diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l index 53e85556c1..a81c8f92c1 100644 --- a/src/glsl/glcpp/glcpp-lex.l +++ b/src/glsl/glcpp/glcpp-lex.l @@ -99,7 +99,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? return HASH_IFNDEF; } -{HASH}if{HSPACE}/.*\n { +{HASH}if{HSPACE}*/[^_a-zA-Z0-9].*\n { yyextra->lexing_if = 1; yyextra->space_tokens = 0; return HASH_IF; diff --git a/src/glsl/glcpp/tests/066-if-nospace-expression.c b/src/glsl/glcpp/tests/066-if-nospace-expression.c new file mode 100644 index 0000000000..3b0b47349d --- /dev/null +++ b/src/glsl/glcpp/tests/066-if-nospace-expression.c @@ -0,0 +1,3 @@ +#if(1) +success +#endif diff --git a/src/glsl/glcpp/tests/066-if-nospace-expression.c.expected b/src/glsl/glcpp/tests/066-if-nospace-expression.c.expected new file mode 100644 index 0000000000..0e84a7cda3 --- /dev/null +++ b/src/glsl/glcpp/tests/066-if-nospace-expression.c.expected @@ -0,0 +1,4 @@ + +success + + |