glsl: add ast/parser support for subroutine parsing storage (v3.2)
[mesa.git] / src / glsl / glsl_lexer.ll
index 1cd1ffb98c6451f9a9efa6af9441e258156cba65..efa0bb6809902e95f2a151d52374881ccdc2ed4b 100644 (file)
@@ -595,6 +595,10 @@ subroutine KEYWORD_WITH_ALT(400, 300, 400, 0, yyextra->ARB_shader_subroutine_ena
                            return classify_identifier(state, yytext);
                        }
 
+\.                     { struct _mesa_glsl_parse_state *state = yyextra;
+                         state->is_field = true;
+                         return DOT_TOK; }
+
 .                      { return yytext[0]; }
 
 %%
@@ -602,6 +606,10 @@ subroutine KEYWORD_WITH_ALT(400, 300, 400, 0, yyextra->ARB_shader_subroutine_ena
 int
 classify_identifier(struct _mesa_glsl_parse_state *state, const char *name)
 {
+   if (state->is_field) {
+      state->is_field = false;
+      return FIELD_SELECTION;
+   }
    if (state->symbols->get_variable(name) || state->symbols->get_function(name))
       return IDENTIFIER;
    else if (state->symbols->get_type(name))