diff options
author | Carl Worth <[email protected]> | 2010-08-17 22:17:09 -0700 |
---|---|---|
committer | Carl Worth <[email protected]> | 2010-08-17 22:17:09 -0700 |
commit | eb26f0d5b68f0218d4c79c1825d0d9e6a905e199 (patch) | |
tree | 152c762f7447b1d601007f81ad0016bcbf998336 /src/glsl/ir_print_visitor.h | |
parent | 4558b634556f42867449a6e60d4badc72099f10d (diff) |
glcpp: Don't include the newline when discarding single-line comments
Matching the newline here meant having to do some redundant work here,
(incrementing line number, resetting column number, and returning a
NEWLINE token), that could otherwise simply be left to the existing rule
which matches a newline.
Worse, when the comment rule matches the newline as well, the parser
can lookahead and see a token for something that should actually be skipped.
For example, in a case like this:
#if 0 // comment here
fail
#else
win
#endif
Both fail and win appear in the output, (not that the condition is being
evaluated incorrectly---merely that one token after the comment's newline
was being lexed/parse regardless of the condition).
This commit fixes the above test case, (which is also remarkably similar
to 087-if-comments which now passes).
Diffstat (limited to 'src/glsl/ir_print_visitor.h')
0 files changed, 0 insertions, 0 deletions