Skip to content

Commit 0e0f101

Browse files
committed
Refactor more
1 parent f480f9a commit 0e0f101

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

src/parser/mod.rs

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18590,24 +18590,15 @@ impl<'a> Parser<'a> {
1859018590
if parser.parse_keyword(Keyword::ROW) {
1859118591
explicit_row = true;
1859218592
}
18593-
18594-
let opening_paren = parser.expect_token(&Token::LParen)?;
18595-
if allow_empty && parser.peek_token().token == Token::RParen {
18596-
let closing_paren = parser.next_token();
18597-
Ok(Parens {
18598-
opening_token: opening_paren.into(),
18599-
content: vec![],
18600-
closing_token: closing_paren.into(),
18601-
})
18602-
} else {
18603-
let exprs = parser.parse_comma_separated(Parser::parse_expr)?;
18604-
let closing_paren = parser.expect_token(&Token::RParen)?;
18605-
Ok(Parens {
18606-
opening_token: opening_paren.into(),
18607-
content: exprs,
18608-
closing_token: closing_paren.into(),
18609-
})
18610-
}
18593+
Ok(Parens {
18594+
opening_token: parser.expect_token(&Token::LParen)?.into(),
18595+
content: if allow_empty && parser.peek_token_ref().token == Token::RParen {
18596+
vec![]
18597+
} else {
18598+
parser.parse_comma_separated(Parser::parse_expr)?
18599+
},
18600+
closing_token: parser.expect_token(&Token::RParen)?.into()
18601+
})
1861118602
})?;
1861218603
Ok(Values {
1861318604
explicit_row,

0 commit comments

Comments
 (0)