mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-03 22:02:51 +01:00
Parser for array type. (#3075)
Co-authored-by: Farzana Ahmed Siddique <fasiddique@google.com>
This commit is contained in:
co-authored by
Farzana Ahmed Siddique
parent
2f70c7d8bb
commit
a67aeb5724
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user