glcpp: Raise error if defining any macro containing two consecutive underscores
authorCarl Worth <cworth@cworth.org>
Fri, 30 Sep 2011 04:44:52 +0000 (21:44 -0700)
committerCarl Worth <cworth@cworth.org>
Fri, 30 Sep 2011 18:44:16 +0000 (11:44 -0700)
commitc4aaf7943c2cdff0e2148b5c05813356dc99696d
tree8b2e4704b1d483107390222e9c41201be2c688a9
parent28842c2331e6df2cbe18c0be3487ece93680075d
glcpp: Raise error if defining any macro containing two consecutive underscores

The specification reserves any macro name containing two consecutive
underscores, (anywhere within the name). Previously, we only raised
this error for macro names that started with two underscores.

Fix the implementation to check for two underscores anywhere, and also
update the corresponding 086-reserved-macro-names test.

This also fixes the following two piglit tests:

spec/glsl-1.30/preprocessor/reserved/double-underscore-02.frag
spec/glsl-1.30/preprocessor/reserved/double-underscore-03.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Carl Worth <cworth@cworth.org>
src/glsl/glcpp/glcpp-parse.y
src/glsl/glcpp/tests/086-reserved-macro-names.c
src/glsl/glcpp/tests/086-reserved-macro-names.c.expected