Mesa (7.9): glcpp: Return NEWLINE token for newlines inside multi-line comments.
Ian Romanick
idr at kemper.freedesktop.org
Tue Dec 14 21:13:05 UTC 2010
Module: Mesa
Branch: 7.9
Commit: 2c57c020a3c96beea7c68cf86fd8b86a045b2def
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2c57c020a3c96beea7c68cf86fd8b86a045b2def
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Wed Oct 20 21:51:03 2010 -0700
glcpp: Return NEWLINE token for newlines inside multi-line comments.
This is necessary for the main compiler to get correct line numbers.
(cherry picked from commit bd55ba568b301d0f764cd1ca015e84e1ae932c8b)
---
src/glsl/glcpp/glcpp-lex.l | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l
index 8eb84ed..e936854 100644
--- a/src/glsl/glcpp/glcpp-lex.l
+++ b/src/glsl/glcpp/glcpp-lex.l
@@ -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)
More information about the mesa-commit
mailing list