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:
Matt Turner
2012-11-20 17:23:42 -08:00
parent 91ca053714
commit aed466192a
5 changed files with 8 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -0,0 +1 @@
#version110

View File

@@ -0,0 +1,2 @@
0:1(3): preprocessor error: Invalid tokens after #

View File

@@ -0,0 +1 @@
#line2

View File

@@ -0,0 +1,2 @@
0:1(3): preprocessor error: Invalid tokens after #