Commit f8dc4fb6 by Jamie Madill Committed by Shannon Woods

A special state to track field selection is not necessary.

Identifier is sufficient to parse struct fieldname. TRAC #23158 Signed-off-by: Nicolas Capens Merged-by: Jamie Madill Authored-by: alokp@chromium.org git-svn-url: https://code.google.com/p/angleproject/source/detail?r=2195 Review URL: https://codereview.appspot.com/8709048
parent 39a8ce6b
......@@ -64,7 +64,6 @@ static int floatsuffix_check(TParseContext* context);
%option noyywrap nounput never-interactive
%option yylineno reentrant bison-bridge
%option extra-type="TParseContext*"
%x FIELDS
D [0-9]
L [a-zA-Z_]
......@@ -342,7 +341,7 @@ O [0-7]
")" { return RIGHT_PAREN; }
("["|"<:") { return LEFT_BRACKET; }
("]"|":>") { return RIGHT_BRACKET; }
"." { BEGIN(FIELDS); return DOT; }
"." { return DOT; }
"!" { return BANG; }
"-" { return DASH; }
"~" { return TILDE; }
......@@ -357,16 +356,9 @@ O [0-7]
"&" { return AMPERSAND; }
"?" { return QUESTION; }
<FIELDS>{L}({L}|{D})* {
BEGIN(INITIAL);
yylval->lex.string = NewPoolTString(yytext);
return FIELD_SELECTION;
}
<FIELDS>[ \t\v\f\r] {}
[ \t\v\n\f\r] { }
<*><<EOF>> { yyterminate(); }
<*>. { assert(false); return 0; }
<<EOF>> { yyterminate(); }
. { assert(false); return 0; }
%%
......
......@@ -268,7 +268,7 @@ postfix_expression
| function_call {
$$ = $1;
}
| postfix_expression DOT FIELD_SELECTION {
| postfix_expression DOT identifier {
$$ = context->addFieldSelectionExpression($1, $2.line, *$3.string, $3.line);
}
| postfix_expression INC_OP {
......@@ -468,13 +468,6 @@ function_identifier
TFunction *function = new TFunction($1.string, type);
$$ = function;
}
| FIELD_SELECTION {
if (context->reservedErrorCheck($1.line, *$1.string))
context->recover();
TType type(EbtVoid, EbpUndefined);
TFunction *function = new TFunction($1.string, type);
$$ = function;
}
;
unary_expression
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment