use super::functions::LogicalTypeFunction;
use super::functions::ValueTypeFunction;
use crate::jsonpath::ast::expr::LogicalExpr;
use crate::jsonpath::ast::literal::Literal;
use crate::jsonpath::ast::query::Query;
use crate::jsonpath::ast::singular_query::SingularQuery;
use regex::Regex;
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum ValueTypeArgument {
Literal(Literal),
SingularQuery(SingularQuery),
Function(Box<ValueTypeFunction>),
}
#[derive(Clone, Debug)]
pub enum RegexValueTypeArgument {
Literal(Regex),
SingularQuery(SingularQuery),
Function(Box<ValueTypeFunction>),
}
impl PartialEq for RegexValueTypeArgument {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::Literal(l0), Self::Literal(r0)) => l0.to_string() == r0.to_string(),
(Self::SingularQuery(l0), Self::SingularQuery(r0)) => l0 == r0,
(Self::Function(l0), Self::Function(r0)) => l0 == r0,
_ => false,
}
}
}
impl Eq for RegexValueTypeArgument {}
#[allow(dead_code)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum LogicalTypeArgument {
LogicalExpr(LogicalExpr),
LogicalTypeFunction(Box<LogicalTypeFunction>),
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum NodesTypeArgument {
FilterQuery(Query),
}