mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-07 22:50:31 +00:00
rename rex to expr in ASTNode
This commit is contained in:
parent
7aab880387
commit
5d62167d6e
2 changed files with 4 additions and 4 deletions
|
@ -56,7 +56,7 @@ pub enum ASTNode {
|
|||
/// Unary expression
|
||||
SQLUnary {
|
||||
operator: SQLOperator,
|
||||
rex: Box<ASTNode>,
|
||||
expr: Box<ASTNode>,
|
||||
},
|
||||
/// SQLValue
|
||||
SQLValue(Value),
|
||||
|
@ -155,8 +155,8 @@ impl ToString for ASTNode {
|
|||
data_type.to_string()
|
||||
),
|
||||
ASTNode::SQLNested(ast) => format!("({})", ast.as_ref().to_string()),
|
||||
ASTNode::SQLUnary { operator, rex } => {
|
||||
format!("{} {}", operator.to_string(), rex.as_ref().to_string())
|
||||
ASTNode::SQLUnary { operator, expr } => {
|
||||
format!("{} {}", operator.to_string(), expr.as_ref().to_string())
|
||||
}
|
||||
ASTNode::SQLValue(v) => v.to_string(),
|
||||
ASTNode::SQLFunction { id, args } => format!(
|
||||
|
|
|
@ -110,7 +110,7 @@ impl Parser {
|
|||
"CASE" => self.parse_case_expression(),
|
||||
"NOT" => Ok(ASTNode::SQLUnary {
|
||||
operator: SQLOperator::Not,
|
||||
rex: Box::new(self.parse_expr(0)?),
|
||||
expr: Box::new(self.parse_expr(0)?),
|
||||
}),
|
||||
_ => return parser_err!(format!("No prefix parser for keyword {}", k)),
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue