summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/target-helpers
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2011-03-01 12:24:58 -0800
committerKenneth Graunke <kenneth@whitecape.org>2011-03-03 10:42:37 -0800
commitf20656e9446b9acde55b9dd41a2b47d7d5b7a56a (patch)
treedb91feead73fa4957ff576b9b52c5084d33cd413 /src/gallium/auxiliary/target-helpers
parentb56f30c2b23f6d7b5499f01fa2d3ee04f2ce546e (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/gallium/auxiliary/target-helpers')
0 files changed, 0 insertions, 0 deletions