mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 16:40:13 +01:00
glcpp: Reject #version and #line not followed by whitespace
Fixes part of es3conform's preprocess16_frag test. Reviewed-by: Carl Worth <cworth@cworth.org>
This commit is contained in:
parent
91ca053714
commit
aed466192a
5 changed files with 8 additions and 2 deletions
|
|
@ -120,7 +120,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
|
|||
return SPACE;
|
||||
}
|
||||
|
||||
{HASH}version {
|
||||
{HASH}version{HSPACE}+ {
|
||||
yylval->str = ralloc_strdup (yyextra, yytext);
|
||||
yyextra->space_tokens = 0;
|
||||
return HASH_VERSION;
|
||||
|
|
@ -135,7 +135,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
|
|||
return OTHER;
|
||||
}
|
||||
|
||||
{HASH}line {
|
||||
{HASH}line{HSPACE}+ {
|
||||
return HASH_LINE;
|
||||
}
|
||||
|
||||
|
|
|
|||
1
src/glsl/glcpp/tests/108-no-space-after-hash-version.c
Normal file
1
src/glsl/glcpp/tests/108-no-space-after-hash-version.c
Normal file
|
|
@ -0,0 +1 @@
|
|||
#version110
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
0:1(3): preprocessor error: Invalid tokens after #
|
||||
|
||||
1
src/glsl/glcpp/tests/109-no-space-after-hash-line.c
Normal file
1
src/glsl/glcpp/tests/109-no-space-after-hash-line.c
Normal file
|
|
@ -0,0 +1 @@
|
|||
#line2
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
0:1(3): preprocessor error: Invalid tokens after #
|
||||
|
||||
Loading…
Add table
Reference in a new issue