glsl: Classify "layout" like other identifiers.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 26 Jul 2013 19:31:06 +0000 (12:31 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 27 Jul 2013 17:31:38 +0000 (10:31 -0700)
When "layout" isn't being lexed as LAYOUT_TOK, we should treat it like
an ordinary identifier.  This means we need to classify it to determine
whether we should return IDENTIFIER, TYPE_IDENTIFIER, or NEW_IDENTIFIER.

Fixes the WebGL conformance test "shader-with-non-reserved-words."

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64087
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
src/glsl/glsl_lexer.ll

index b95b254da017b1318ef29739d385a549fc7b886c..93752307da484b4f7cb8e7b8f215b3190bab22b2 100644 (file)
@@ -352,7 +352,7 @@ layout              {
                      return LAYOUT_TOK;
                   } else {
                      yylval->identifier = strdup(yytext);
-                     return IDENTIFIER;
+                     return classify_identifier(yyextra, yytext);
                   }
                }