glcpp: Reject token pasting operator in GLES
authorMatt Turner <mattst88@gmail.com>
Tue, 27 Nov 2012 20:18:02 +0000 (12:18 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 11 Jan 2013 18:57:25 +0000 (10:57 -0800)
The GLSL ES 3.0 spec (Section 12.17) says:
"GLSL ES 1.00 removed token pasting and other functionality."

NOTE: This is a candidate for the stable branches.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
src/glsl/glcpp/glcpp-lex.l

index fd28711..a029f62 100644 (file)
@@ -260,6 +260,8 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
 }
 
 "##" {
+       if (parser->is_gles)
+               glcpp_error(yylloc, yyextra, "Token pasting (##) is illegal in GLES");
        return PASTE;
 }