summaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp/glcpp-lex.l
diff options
context:
space:
mode:
authorCarl Worth <[email protected]>2014-07-02 10:27:50 -0700
committerIan Romanick <[email protected]>2014-08-07 16:08:29 -0700
commitbf9bce5bea17e8034927e34bcafa4c694790d9b9 (patch)
tree2f2b37999307d1d91eb49ec1e0480af16f9ea279 /src/glsl/glcpp/glcpp-lex.l
parent9a54b07651f80c394fb5386855b6611aa722a34b (diff)
glsl/glcpp: Fix #pragma to not over-increment the line-number count
Previously, the #pragma directive was swallowing an entire line, (including the final newline). At that time it was appropriate for it to increment the line count. More recently, our handling of #pragma changed to not include the newline. But the code to increment yylineno stuck around. This was causing __LINE__ to be increased by one more than desired for every #pragma. Remove the bogus, extra increment, and add a test for this case. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/glcpp/glcpp-lex.l')
-rw-r--r--src/glsl/glcpp/glcpp-lex.l2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l
index 2b92fd37e2b..430abd4bfa3 100644
--- a/src/glsl/glcpp/glcpp-lex.l
+++ b/src/glsl/glcpp/glcpp-lex.l
@@ -291,8 +291,6 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
* Simply pass them through to the main compiler's lexer/parser. */
<HASH>(extension|pragma)[^\r\n]* {
BEGIN INITIAL;
- yylineno++;
- yycolumn = 0;
RETURN_STRING_TOKEN (PRAGMA);
}