mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:01:08 +01:00
Fix function parameter parsing past 2 params. (#2542)
The comment on FunctionParameterFinish is actually correct (`1. FunctionParameter`), just a typo in the implementation. It specifically failed parsing at the comma after the 2nd param, regardless of whether there were more params.
This commit is contained in:
@@ -1090,7 +1090,7 @@ auto Parser::HandleFunctionParameterFinishState() -> void {
|
||||
|
||||
if (ConsumeListToken(ParseNodeKind::ParameterListComma, TokenKind::CloseParen,
|
||||
state.has_error) == ListTokenKind::Comma) {
|
||||
PushState(ParserState::PatternAsFunctionParameter);
|
||||
PushState(ParserState::FunctionParameter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user