mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-26 23:49:10 +00:00
Join match arms for Keyword and binary ops
because they share implementation.
This commit is contained in:
parent
3de2a0952c
commit
d73a1e0e1d
1 changed files with 6 additions and 10 deletions
|
@ -276,12 +276,12 @@ impl Parser {
|
||||||
parser_err!("Invalid tokens after NOT")
|
parser_err!("Invalid tokens after NOT")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Token::Keyword(_) => Ok(Some(ASTNode::SQLBinaryExpr {
|
Token::DoubleColon => {
|
||||||
left: Box::new(expr),
|
let pg_cast = self.parse_pg_cast(expr)?;
|
||||||
op: self.to_sql_operator(&tok)?,
|
Ok(Some(pg_cast))
|
||||||
right: Box::new(self.parse_expr(precedence)?),
|
}
|
||||||
})),
|
Token::Keyword(_)
|
||||||
Token::Eq
|
| Token::Eq
|
||||||
| Token::Neq
|
| Token::Neq
|
||||||
| Token::Gt
|
| Token::Gt
|
||||||
| Token::GtEq
|
| Token::GtEq
|
||||||
|
@ -296,10 +296,6 @@ impl Parser {
|
||||||
op: self.to_sql_operator(&tok)?,
|
op: self.to_sql_operator(&tok)?,
|
||||||
right: Box::new(self.parse_expr(precedence)?),
|
right: Box::new(self.parse_expr(precedence)?),
|
||||||
})),
|
})),
|
||||||
Token::DoubleColon => {
|
|
||||||
let pg_cast = self.parse_pg_cast(expr)?;
|
|
||||||
Ok(Some(pg_cast))
|
|
||||||
}
|
|
||||||
_ => parser_err!(format!("No infix parser for token {:?}", tok)),
|
_ => parser_err!(format!("No infix parser for token {:?}", tok)),
|
||||||
},
|
},
|
||||||
None => Ok(None),
|
None => Ok(None),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue