mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-23 15:34:09 +00:00
Remove parse_function_or_pg_cast, since fn(...) :: type
is taken care of in parse_infix()
This commit is contained in:
parent
eff92a2dc1
commit
52277c3025
1 changed files with 1 additions and 10 deletions
|
@ -108,7 +108,7 @@ impl Parser {
|
||||||
self.parse_cast_expression()
|
self.parse_cast_expression()
|
||||||
} else {
|
} else {
|
||||||
match self.peek_token() {
|
match self.peek_token() {
|
||||||
Some(Token::LParen) => self.parse_function_or_pg_cast(&id),
|
Some(Token::LParen) => self.parse_function(&id),
|
||||||
Some(Token::Period) => {
|
Some(Token::Period) => {
|
||||||
let mut id_parts: Vec<String> = vec![id];
|
let mut id_parts: Vec<String> = vec![id];
|
||||||
while self.peek_token() == Some(Token::Period) {
|
while self.peek_token() == Some(Token::Period) {
|
||||||
|
@ -151,15 +151,6 @@ impl Parser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn parse_function_or_pg_cast(&mut self, id: &str) -> Result<ASTNode, ParserError> {
|
|
||||||
let func = self.parse_function(&id)?;
|
|
||||||
if let Some(Token::DoubleColon) = self.peek_token() {
|
|
||||||
self.parse_pg_cast(func)
|
|
||||||
} else {
|
|
||||||
Ok(func)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn parse_function(&mut self, id: &str) -> Result<ASTNode, ParserError> {
|
pub fn parse_function(&mut self, id: &str) -> Result<ASTNode, ParserError> {
|
||||||
self.consume_token(&Token::LParen)?;
|
self.consume_token(&Token::LParen)?;
|
||||||
if let Ok(true) = self.consume_token(&Token::RParen) {
|
if let Ok(true) = self.consume_token(&Token::RParen) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue