Browse Source

glsl: Add an internal-error catch-all rule

This is to avoid the default, silent flex rule which simply prints the
character to stdout.

For the following Khronos GLES3 conformance tests:

	invalid_char_in_name_vertex
	invalid_char_in_name_fragment

With this commit, these tests now report Pass where they previously reported
Fail, but Mesa isn't behaving correctly yet. It's now reporting the internal
error where what is really desired is a syntax error.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
tags/10.3-branchpoint
Carl Worth 11 years ago
parent
commit
f196eb2d39
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      src/glsl/glsl_lexer.ll

+ 13
- 0
src/glsl/glsl_lexer.ll View File

%option prefix="_mesa_glsl_lexer_" %option prefix="_mesa_glsl_lexer_"
%option extra-type="struct _mesa_glsl_parse_state *" %option extra-type="struct _mesa_glsl_parse_state *"


/* Note: When adding any start conditions to this list, you must also
* update the "Internal compiler error" catch-all rule near the end of
* this file. */
%x PP PRAGMA %x PP PRAGMA


DEC_INT [1-9][0-9]* DEC_INT [1-9][0-9]*


. { return yytext[0]; } . { return yytext[0]; }


/* This is a catch-all to avoid the annoying default flex action which
* matches any character and prints it. If any input ever matches this
* rule, then we have made a mistake above and need to fix one or more
* of the preceding patterns to match that input. */
<PP,PRAGMA>. {
_mesa_glsl_error(yylloc, yyextra,
"Internal compiler error: Unexpected character: %s", yytext);
}


%% %%


int int

Loading…
Cancel
Save