mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +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
@@ -112,10 +112,13 @@ class ParserContext {
|
||||
auto ConsumeAndAddOpenParen(TokenizedBuffer::Token default_token,
|
||||
ParseNodeKind start_kind) -> void;
|
||||
|
||||
// Parses a close paren token corresponding to the given open paren token,
|
||||
// possibly skipping forward and diagnosing if necessary. Creates a parse node
|
||||
// of the specified close kind.
|
||||
auto ConsumeAndAddCloseParen(StateStackEntry state, ParseNodeKind close_kind)
|
||||
// Parses a closing symbol corresponding to the opening symbol
|
||||
// `expected_open`, possibly skipping forward and diagnosing if necessary.
|
||||
// Creates a parse node of the specified close kind. If `expected_open` is not
|
||||
// an opening symbol, the parse node will be associated with `state.token`,
|
||||
// no input will be consumed, and no diagnostic will be emitted.
|
||||
auto ConsumeAndAddCloseSymbol(TokenizedBuffer::Token expected_open,
|
||||
StateStackEntry state, ParseNodeKind close_kind)
|
||||
-> void;
|
||||
|
||||
// Composes `ConsumeIf` and `AddLeafNode`, returning false when ConsumeIf
|
||||
|
||||
Reference in New Issue
Block a user