use serde::Serialize;
use super::{Element, Span};
#[derive(Debug, Clone, Serialize, PartialEq)]
pub enum LogicalOperatorKind {
Or, And, Not, }
#[derive(Debug, Clone, Serialize)]
pub struct LogicalOperator {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub span: Span,
pub kind: LogicalOperatorKind,
}
#[derive(Debug, Clone, Serialize, PartialEq)]
pub enum ComparisonOperatorKind {
Equal, NotEqual, GreaterThan, LessThan, GreaterEqual, LessEqual, }
#[derive(Debug, Clone, Serialize)]
pub struct ComparisonOperator {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub span: Span,
pub kind: ComparisonOperatorKind,
}
#[derive(Debug, Clone, Serialize)]
pub enum Expression {
Or {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
span: Span,
operator: LogicalOperator,
left: Box<Expression>,
right: Box<Expression>,
},
And {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
span: Span,
operator: LogicalOperator,
left: Box<Expression>,
right: Box<Expression>,
},
Not {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
span: Span,
operator: LogicalOperator,
inner: Box<Expression>,
},
Comparison {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
span: Span,
left: Box<Expression>,
operator: ComparisonOperator,
right: Box<Expression>,
},
FunctionCall {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
span: Span,
name: String,
arguments: Vec<Expression>,
},
StringLiteral {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
span: Span,
value: Vec<Element>,
},
NumberLiteral {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
span: Span,
value: i64,
},
BoolLiteral {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
span: Span,
value: bool,
},
Null {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
span: Span,
},
Group {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
span: Span,
inner: Box<Expression>,
},
Element(Box<Element>),
}