glcpp: Remove spurious newline generated by #version handling.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 16 Aug 2010 20:42:04 +0000 (13:42 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 16 Aug 2010 20:43:35 +0000 (13:43 -0700)
This was causing line numbering to be off by one.  The newline comes
from the NEWLINE token at the end of the line; there's no need to
insert one.

src/glsl/glcpp/glcpp-lex.l
src/glsl/glcpp/glcpp-parse.y

index 1cd95b238d2f0de8d05b3c363f294d3656a2e5b3..9187926146aeeecad5d664dda9f73e3a46a2b1aa 100644 (file)
@@ -88,10 +88,8 @@ HEXADECIMAL_INTEGER  0[xX][0-9a-fA-F]+[uU]?
                return SPACE;
 }
 
-{HASH}(version) {
+{HASH}version {
        yylval->str = talloc_strdup (yyextra, yytext);
-       yylineno++;
-       yycolumn = 0;
        yyextra->space_tokens = 0;
        return HASH_VERSION;
 }
index 3d08ce6c75fe463b034f72fad3582ec274766add..c91da15519edb2779efe6f7f207c5154b78f132c 100644 (file)
@@ -309,7 +309,7 @@ control_line:
                        talloc_free (macro);
                }
                add_builtin_define (parser, "__VERSION__", $2);
-               glcpp_printf(parser->output, "#version %" PRIiMAX "\n", $2);
+               glcpp_printf(parser->output, "#version %" PRIiMAX, $2);
        }
 |      HASH NEWLINE
 ;