iffyio commented on code in PR #2123:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2123#discussion_r2606325817
##########
src/parser/mod.rs:
##########
@@ -1222,6 +1222,17 @@ impl<'a> Parser<'a> {
Token::Mul => {
return Ok(Expr::Wildcard(AttachedToken(next_token)));
}
+ // Handle parenthesized wildcard: (*)
+ Token::LParen => {
+ let [maybe_mul, maybe_rparen] = self.peek_tokens_ref();
+ if maybe_mul.token == Token::Mul && maybe_rparen.token ==
Token::RParen {
+ let mul_token = self.next_token(); // consume Mul
+ self.next_token(); // consume RParen
+ return Ok(Expr::Wildcard(AttachedToken(mul_token)));
+ }
+ // Not a (*), fall through to reset index and call parse_expr
+ self.prev_token();
Review Comment:
calling `self.prev_token()` doesn't seem needed? similar to the `_` branch,
the fall-through paths call `self.index = index;` to reset at the end it looks
like
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]