-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
From #63337 (comment)
The following code should be using the common list parsing utilities:
rust/src/libsyntax/parse/parser.rs
Lines 2052 to 2070 in 2d1a551
while self.token != token::CloseDelim(token::Paren) { | |
es.push(match self.parse_expr() { | |
Ok(es) => es, | |
Err(err) => { | |
// recover from parse error in tuple list | |
return Ok(self.recover_seq_parse_error(token::Paren, lo, Err(err))); | |
} | |
}); | |
recovered = self.expect_one_of( | |
&[], | |
&[token::Comma, token::CloseDelim(token::Paren)], | |
)?; | |
if self.eat(&token::Comma) { | |
trailing_comma = true; | |
} else { | |
trailing_comma = false; | |
break; | |
} | |
} |
CC @Centril
Centril
Metadata
Metadata
Assignees
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.