mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Parser for index expression such as a[0] (#3033)
Co-authored-by: Farzana Ahmed Siddique <fasiddique@google.com>
This commit is contained in:
co-authored by
Farzana Ahmed Siddique
parent
9e03d5efe2
commit
6cca85534f
@@ -137,6 +137,12 @@ auto ParserHandleExpressionInPostfixLoop(ParserContext& context) -> void {
|
||||
context.PushState(state);
|
||||
break;
|
||||
}
|
||||
case TokenKind::OpenSquareBracket: {
|
||||
context.PushState(state);
|
||||
state.state = ParserState::IndexExpression;
|
||||
context.PushState(state);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
if (state.has_error) {
|
||||
context.ReturnErrorOnState();
|
||||
|
||||
Reference in New Issue
Block a user