mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 21:21:04 +01:00
Handle malformed subscript expressions (#3064)
Closes #3063 --------- Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Richard Smith
parent
7feaed312a
commit
049fbc1ee4
@@ -19,9 +19,9 @@ auto ParserHandleIndexExpression(ParserContext& context) -> void {
|
||||
|
||||
auto ParserHandleIndexExpressionFinish(ParserContext& context) -> void {
|
||||
auto state = context.PopState();
|
||||
context.AddNode(ParseNodeKind::IndexExpression,
|
||||
context.ConsumeChecked(TokenKind::CloseSquareBracket),
|
||||
state.subtree_start, state.has_error);
|
||||
|
||||
context.ConsumeAndAddCloseSymbol(state.token, state,
|
||||
ParseNodeKind::IndexExpression);
|
||||
}
|
||||
|
||||
} // namespace Carbon
|
||||
|
||||
Reference in New Issue
Block a user