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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Carl Worth 2014-07-01 17:58:37 -07:00 committed by Ian Romanick
parent e84e159caa
commit c0127c30dd
1 changed files with 1 additions and 1 deletions

View File

@ -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 */