glcpp: Add support for __LINE__ and __FILE__ macros
authorCarl Worth <cworth@cworth.org>
Wed, 28 Nov 2012 19:52:05 +0000 (11:52 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 29 Nov 2012 21:03:01 +0000 (13:03 -0800)
commit907a10378e4c63686abe0739634b30615018ccd1
treefe6584d0a6524eea4ae8c206a02f4aa359d5723f
parentdbd6135bc1ba285128ab991c03c4df6fbd6fefe8
glcpp: Add support for __LINE__ and __FILE__ macros

These tokens are easy to expand by just looking at the current, tracked
location values, (and no need to look anything up in the hash table).

Add a test which verifies __LINE__ with several values, (and verifies __FILE__
for the single value of 0). Our testing framework isn't sophisticated enough
here to have a test with multiple file inputs.

This commit fixes part of es3conform's preprocess16_frag test.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/glcpp/glcpp-parse.y
src/glsl/glcpp/tests/113-line-and-file-macros.c [new file with mode: 0644]
src/glsl/glcpp/tests/113-line-and-file-macros.c.expected [new file with mode: 0644]