mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-27 04:40:31 +01:00
glsl/glcpp: Combine the two rules matching any character
Using a single rule here means that we can use the <*> syntax to match all start conditions. This makes the catch-all rule more robust against the addition of future start conditions, (no need to maintain an ever- growing list of start conditions for this rul). Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
This commit is contained in:
parent
80e9301d9b
commit
4ebff9bca6
1 changed files with 6 additions and 6 deletions
|
|
@ -543,17 +543,17 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
|
|||
* rule, then we have made a mistake above and need to fix one or more
|
||||
* of the preceding patterns to match that input. */
|
||||
|
||||
<INITIAL,COMMENT,DEFINE,DONE,HASH,NEWLINE_CATCHUP>. {
|
||||
<*>. {
|
||||
glcpp_error(yylloc, yyextra, "Internal compiler error: Unexpected character: %s", yytext);
|
||||
}
|
||||
|
||||
/* We don't actually use the UNREACHABLE start condition. We
|
||||
only have this action here so that we can pretend to call some
|
||||
only have this block here so that we can pretend to call some
|
||||
generated functions, (to avoid "defined but not used"
|
||||
warnings. */
|
||||
<UNREACHABLE>. {
|
||||
unput('.');
|
||||
yy_top_state(yyextra);
|
||||
if (YY_START == UNREACHABLE) {
|
||||
unput('.');
|
||||
yy_top_state(yyextra);
|
||||
}
|
||||
}
|
||||
|
||||
%%
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue