rename rex to expr in ASTNode

This commit is contained in:
Andy Grove 2018-12-16 14:04:51 -07:00
parent 7aab880387
commit 5d62167d6e
2 changed files with 4 additions and 4 deletions

View file

@ -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!(

View file

@ -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)),
},