Parser for array type. (#3075)

Co-authored-by: Farzana Ahmed Siddique <fasiddique@google.com>
This commit is contained in:
Farzana Ahmed Siddique
2023-08-09 19:04:44 +00:00
committed by GitHub
co-authored by Farzana Ahmed Siddique
parent 2f70c7d8bb
commit a67aeb5724
10 changed files with 211 additions and 2 deletions
@@ -88,6 +88,11 @@ auto ParserHandleExpressionInPostfix(ParserContext& context) -> void {
context.PushState(ParserState::ParenExpression);
break;
}
case TokenKind::OpenSquareBracket: {
context.PushState(state);
context.PushState(ParserState::ArrayExpression);
break;
}
case TokenKind::SelfValueIdentifier: {
context.AddLeafNode(ParseNodeKind::SelfValueName, context.Consume());
context.PushState(state);
@@ -115,9 +120,7 @@ auto ParserHandleExpressionInPostfixLoop(ParserContext& context) -> void {
// This is a cyclic state that repeats, so this state is typically pushed back
// on.
auto state = context.PopState();
state.token = *context.position();
switch (context.PositionKind()) {
case TokenKind::Period: {
context.PushState(state);