glsl/glcpp: Fix #pragma to not over-increment the line-number count
authorCarl Worth <cworth@cworth.org>
Wed, 2 Jul 2014 17:27:50 +0000 (10:27 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 7 Aug 2014 23:08:29 +0000 (16:08 -0700)
commitbf9bce5bea17e8034927e34bcafa4c694790d9b9
tree2f2b37999307d1d91eb49ec1e0480af16f9ea279
parent9a54b07651f80c394fb5386855b6611aa722a34b
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 <ian.d.romanick@intel.com>
src/glsl/glcpp/glcpp-lex.l
src/glsl/glcpp/tests/141-pragma-and-__LINE__.c [new file with mode: 0644]
src/glsl/glcpp/tests/141-pragma-and-__LINE__.c.expected [new file with mode: 0644]