-
Notifications
You must be signed in to change notification settings - Fork 675
Support parsing parenthesized wildcard (*)
#2123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1222,6 +1222,15 @@ impl<'a> Parser<'a> { | |
| Token::Mul => { | ||
| return Ok(Expr::Wildcard(AttachedToken(next_token))); | ||
| } | ||
| // Handle parenthesized wildcard: (*) | ||
| Token::LParen => { | ||
| let inner_token = self.next_token(); | ||
| if inner_token.token == Token::Mul && self.peek_token().token == Token::RParen { | ||
| self.next_token(); // consume RParen | ||
| return Ok(Expr::Wildcard(AttachedToken(inner_token))); | ||
| } | ||
| // Not a (*), reset and fall through to parse_expr | ||
|
||
| } | ||
| _ => (), | ||
| }; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17905,3 +17905,22 @@ fn test_parse_set_session_authorization() { | |||||
| })) | ||||||
| ); | ||||||
| } | ||||||
|
|
||||||
| #[test] | ||||||
| fn parse_select_distinct_parenthesized_wildcard() { | ||||||
|
||||||
| fn parse_select_distinct_parenthesized_wildcard() { | |
| fn parse_select_parenthesized_wildcard() { |
thinking since the syntax isn't implemented solely on the distinct keyword?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be simplified by calling
self.peek_tokens_ref(Token::MUL, Token::RParen)?