glcpp: Return NEWLINE token for newlines inside multi-line comments.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Oct 2010 04:51:03 +0000 (21:51 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Oct 2010 07:13:33 +0000 (00:13 -0700)
This is necessary for the main compiler to get correct line numbers.

src/glsl/glcpp/glcpp-lex.l

index 8eb84ed..e936854 100644 (file)
@@ -82,9 +82,9 @@ HEXADECIMAL_INTEGER   0[xX][0-9a-fA-F]+[uU]?
        /* Multi-line comments */
 "/*"                    { yy_push_state(COMMENT, yyscanner); }
 <COMMENT>[^*\n]*
-<COMMENT>[^*\n]*\n      { yylineno++; yycolumn = 0; }
+<COMMENT>[^*\n]*\n      { yylineno++; yycolumn = 0; return NEWLINE; }
 <COMMENT>"*"+[^*/\n]*
-<COMMENT>"*"+[^*/\n]*\n { yylineno++; yycolumn = 0; }
+<COMMENT>"*"+[^*/\n]*\n { yylineno++; yycolumn = 0; return NEWLINE; }
 <COMMENT>"*"+"/"        {
        yy_pop_state(yyscanner);
        if (yyextra->space_tokens)