mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 17:13:16 +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
@@ -32,13 +32,17 @@ auto ParserHandleParenConditionAsWhile(ParserContext& context) -> void {
|
||||
auto ParserHandleParenConditionFinishAsIf(ParserContext& context) -> void {
|
||||
auto state = context.PopState();
|
||||
|
||||
context.ConsumeAndAddCloseParen(state, ParseNodeKind::IfCondition);
|
||||
context.ConsumeAndAddCloseSymbol(
|
||||
*(TokenizedBuffer::TokenIterator(state.token) + 1), state,
|
||||
ParseNodeKind::IfCondition);
|
||||
}
|
||||
|
||||
auto ParserHandleParenConditionFinishAsWhile(ParserContext& context) -> void {
|
||||
auto state = context.PopState();
|
||||
|
||||
context.ConsumeAndAddCloseParen(state, ParseNodeKind::WhileCondition);
|
||||
context.ConsumeAndAddCloseSymbol(
|
||||
*(TokenizedBuffer::TokenIterator(state.token) + 1), state,
|
||||
ParseNodeKind::WhileCondition);
|
||||
}
|
||||
|
||||
} // namespace Carbon
|
||||
|
||||
Reference in New Issue
Block a user