glcpp: Implement token pasting for non-function-like macros
authorCarl Worth <cworth@cworth.org>
Fri, 30 Sep 2011 00:04:47 +0000 (17:04 -0700)
committerCarl Worth <cworth@cworth.org>
Fri, 30 Sep 2011 18:44:10 +0000 (11:44 -0700)
commit28842c2331e6df2cbe18c0be3487ece93680075d
tree33bf0f64352bdad368f12bb823262fdd11deabbf
parent7bb3403e0172a440b8100bcf1db8462f50a254cc
glcpp: Implement token pasting for non-function-like macros

This is as simple as abstracting one existing block of code into a
function call and then adding a single call to that function for the
case of a non-function-like macro.

This fixes the recently-added 097-paste-with-non-function-macro test
as well as the following piglit tests:

spec/glsl-1.30/preprocessor/concat/concat-01.frag
spec/glsl-1.30/preprocessor/concat/concat-02.frag

Also, the concat-04.frag test now passes for the right reason. The
test is intended to fail the compilation, but before this commit it
was failing compilation (and hence passing the test) for the wrong
reason.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
src/glsl/glcpp/glcpp-parse.y