Remove parse_function_or_pg_cast, since fn(...) :: type is taken care of in parse_infix()

This commit is contained in:
Nickolay Ponomarev 2019-01-11 01:54:57 +03:00
parent eff92a2dc1
commit 52277c3025

View file

@ -108,7 +108,7 @@ impl Parser {
self.parse_cast_expression()
} else {
match self.peek_token() {
Some(Token::LParen) => self.parse_function_or_pg_cast(&id),
Some(Token::LParen) => self.parse_function(&id),
Some(Token::Period) => {
let mut id_parts: Vec<String> = vec![id];
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> {
self.consume_token(&Token::LParen)?;
if let Ok(true) = self.consume_token(&Token::RParen) {