glsl_lexer: centroid and invariant are not reserved words in GLSL 1.10
authorIan Romanick <ian.d.romanick@intel.com>
Sat, 19 Jun 2010 01:40:12 +0000 (18:40 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Sat, 19 Jun 2010 02:02:45 +0000 (19:02 -0700)
glsl_lexer.lpp

index 5cea534bafdb6b5a6e547d03be430738bde043cf..cd150f81ca11ba828aac956f53d618757735b96b 100644 (file)
@@ -156,8 +156,22 @@ out                return OUT;
 inout          return INOUT;
 uniform                return UNIFORM;
 varying                return VARYING;
-centroid       return CENTROID;
-invariant      return INVARIANT;
+centroid       {
+                  if (yyextra->language_version >= 120) {
+                     return CENTROID;
+                  } else {
+                     yylval->identifier = strdup(yytext);
+                     return IDENTIFIER;
+                  }
+               }
+invariant      {
+                  if (yyextra->language_version >= 120) {
+                     return INVARIANT;
+                  } else {
+                     yylval->identifier = strdup(yytext);
+                     return IDENTIFIER;
+                  }
+               }
 
 flat           {
                   if (yyextra->language_version >= 130) {