diff options
author | Kenneth Graunke <[email protected]> | 2011-03-01 12:24:58 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2011-03-03 10:42:37 -0800 |
commit | f20656e9446b9acde55b9dd41a2b47d7d5b7a56a (patch) | |
tree | db91feead73fa4957ff576b9b52c5084d33cd413 /src/glsl/lower_texture_projection.cpp | |
parent | b56f30c2b23f6d7b5499f01fa2d3ee04f2ce546e (diff) |
glcpp: Rework lexer to use a SKIP state rather than REJECT.
Previously, the rule deleted by this commit was matched every single
time (being the longest match). If not skipping, it used REJECT to
continue on to the actual correct rule.
The flex manual advises against using REJECT where possible, as it is
one of the most expensive lexer features. So using it on every match
seems undesirable. Perhaps more importantly, it made it necessary for
the #if directive rules to contain a look-ahead pattern to make them
as long as the (now deleted) "skip the whole line" rule.
This patch introduces an exclusive start state, SKIP, to avoid REJECTs.
Each time the lexer is called, the code at the top of the rules section
will run, implicitly switching the state to the correct one.
Fixes piglit tests 16384-consecutive-chars.frag and
16385-consecutive-chars.frag.
Diffstat (limited to 'src/glsl/lower_texture_projection.cpp')
0 files changed, 0 insertions, 0 deletions