diff options
author | Carl Worth <[email protected]> | 2014-06-20 13:44:51 -0700 |
---|---|---|
committer | Carl Worth <[email protected]> | 2014-07-29 15:11:48 -0700 |
commit | 21dda50549c5f220eff7ec04a72fb02e5eb09e76 (patch) | |
tree | 3f377c3ba8544729ae7326bda16e4e76924511e1 /src | |
parent | cc335c0e57a92fd78141894350607eca3622465a (diff) |
glsl/glcpp: Remove some un-needed calls to NEWLINE_CATCHUP
The NEWLINE_CATCHUP code is only intended to be invoked after we lex an actual
newline character ('\n'). The two extra calls here were apparently added
accidentally because the pattern happened to contain a (negated) '\n',
(see commit 6005e9cb283214cd57038c7c5e7758ba72ec6ac2).
I don't think either case could have caused any actual bug. (In the first
case, the pattern matched right up to the next newline, so the NEWLINE_CATCHUP
code was just about to be called. In the second case, I don't think it's
possible to actually enter the <SKIP> start condition after commented newlines
without any intervening newline.)
But, if nothing else, the code is cleaner without these extra calls.
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/glcpp/glcpp-lex.l | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l index a9801f4b6a4..5f0bb324990 100644 --- a/src/glsl/glcpp/glcpp-lex.l +++ b/src/glsl/glcpp/glcpp-lex.l @@ -181,8 +181,6 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? /* glcpp doesn't handle #extension, #version, or #pragma directives. * Simply pass them through to the main compiler's lexer/parser. */ {HASH}(extension|pragma)[^\n]* { - if (parser->commented_newlines) - BEGIN NEWLINE_CATCHUP; yylval->str = ralloc_strdup (yyextra, yytext); yylineno++; yycolumn = 0; @@ -230,8 +228,6 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? } <SKIP>[^\n] { - if (parser->commented_newlines) - BEGIN NEWLINE_CATCHUP; } {HASH}error.* { |