mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 06:18:17 +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")
|
||||
}
|
||||
}
|
||||
Token::Keyword(_) => Ok(Some(ASTNode::SQLBinaryExpr {
|
||||
left: Box::new(expr),
|
||||
op: self.to_sql_operator(&tok)?,
|
||||
right: Box::new(self.parse_expr(precedence)?),
|
||||
})),
|
||||
Token::Eq
|
||||
Token::DoubleColon => {
|
||||
let pg_cast = self.parse_pg_cast(expr)?;
|
||||
Ok(Some(pg_cast))
|
||||
}
|
||||
Token::Keyword(_)
|
||||
| Token::Eq
|
||||
| Token::Neq
|
||||
| Token::Gt
|
||||
| Token::GtEq
|
||||
|
@ -296,10 +296,6 @@ impl Parser {
|
|||
op: self.to_sql_operator(&tok)?,
|
||||
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)),
|
||||
},
|
||||
None => Ok(None),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue