pub enum Expr {
AbsolutePath(Box<Expr>),
RelativePath(Box<Expr>, Box<Expr>),
Step(Step),
Filter(Box<Expr>, Vec<Expr>),
Variable(String),
StringLiteral(String),
NumberLiteral(f64),
BooleanLiteral(bool),
FunctionCall {
name: String,
args: Vec<Expr>,
},
BinaryOp {
op: BinaryOp,
left: Box<Expr>,
right: Box<Expr>,
},
UnaryMinus(Box<Expr>),
Union(Box<Expr>, Box<Expr>),
}Expand description
XPath expression AST node.
Variants§
AbsolutePath(Box<Expr>)
Absolute location path: /expr
RelativePath(Box<Expr>, Box<Expr>)
Relative location path: step1/step2
Step(Step)
A single step
Filter(Box<Expr>, Vec<Expr>)
Filter expression: primary[pred1][pred2]
Variable(String)
Variable reference: $name
StringLiteral(String)
String literal: 'hello'
NumberLiteral(f64)
Numeric literal: 42 or 3.14
BooleanLiteral(bool)
Boolean literal
FunctionCall
Function call: name(arg1, arg2)
BinaryOp
Binary operation: left op right
UnaryMinus(Box<Expr>)
Unary minus: -expr
Union(Box<Expr>, Box<Expr>)
Union expression: left | right
Implementations§
Source§impl Expr
impl Expr
Sourcepub fn is_location_path(&self) -> bool
pub fn is_location_path(&self) -> bool
Check if this expression is a location path (returns nodeset).
Sourcepub fn is_constant(&self) -> bool
pub fn is_constant(&self) -> bool
Check if this is a constant value (no evaluation needed).
Trait Implementations§
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more