ソースを参照

glsl: Properly lex extra tokens when handling # directives.

Without this, in the <PP> state, we would hit Flex's default rule, which
prints tokens to stdout, rather than returning them as tokens. (Or, after the
previous commit, we would hit the new catch-all rule and generate an internal
compiler error.)

With this commit in place, we generate the desired syntax error.

This manifested as a weird bug where shaders with semicolons after
extension directives, such as:

   #extension GL_foo_bar : enable;

would print semicolons to the screen, but otherwise compile just fine
(even though this is illegal).

Fixes Piglit's extension-semicolon.frag test.

This also fixes the following Khronos GLES3 conformance tests, (and for real
this time):

	invalid_char_in_name_vertex
	invalid_char_in_name_fragment

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
tags/10.3-branchpoint
Kenneth Graunke 11年前
コミット
de0b4b6607
1個のファイルの変更1行の追加0行の削除
  1. 1
    0
      src/glsl/glsl_lexer.ll

+ 1
- 0
src/glsl/glsl_lexer.ll ファイルの表示

@@ -239,6 +239,7 @@ HASH ^{SPC}#{SPC}
return INTCONSTANT;
}
<PP>\n { BEGIN 0; yylineno++; yycolumn = 0; return EOL; }
<PP>. { return yytext[0]; }

\n { yylineno++; yycolumn = 0; }


読み込み中…
キャンセル
保存