pub enum Expression {
Show 19 variants
Literal {
value: XdlValue,
location: Location,
},
Variable {
name: String,
location: Location,
},
SystemVariable {
name: String,
location: Location,
},
ArrayRef {
array: Box<Expression>,
indices: Vec<ArrayIndex>,
location: Location,
},
StructRef {
object: Box<Expression>,
field: String,
location: Location,
},
MethodCall {
object: Box<Expression>,
method: String,
args: Vec<Expression>,
keywords: Vec<Keyword>,
location: Location,
},
FunctionCall {
name: String,
args: Vec<Expression>,
keywords: Vec<Keyword>,
location: Location,
},
Binary {
op: BinaryOp,
left: Box<Expression>,
right: Box<Expression>,
location: Location,
},
Unary {
op: UnaryOp,
expr: Box<Expression>,
location: Location,
},
Ternary {
condition: Box<Expression>,
if_true: Box<Expression>,
if_false: Box<Expression>,
location: Location,
},
ArrayDef {
elements: Vec<Expression>,
location: Location,
},
StructDef {
name: Option<String>,
fields: Vec<StructField>,
location: Location,
},
Pointer {
expr: Box<Expression>,
location: Location,
},
Deref {
expr: Box<Expression>,
location: Location,
},
PostIncrement {
expr: Box<Expression>,
location: Location,
},
PostDecrement {
expr: Box<Expression>,
location: Location,
},
PreIncrement {
expr: Box<Expression>,
location: Location,
},
PreDecrement {
expr: Box<Expression>,
location: Location,
},
ObjectNew {
class_name: String,
args: Vec<Expression>,
keywords: Vec<Keyword>,
location: Location,
},
}Expand description
XDL Expressions
Variants§
Literal
Variable
SystemVariable
ArrayRef
StructRef
MethodCall
FunctionCall
Binary
Unary
Ternary
ArrayDef
StructDef
Pointer
Deref
PostIncrement
PostDecrement
PreIncrement
PreDecrement
ObjectNew
Implementations§
Source§impl Expression
impl Expression
Sourcepub fn is_constant(&self) -> bool
pub fn is_constant(&self) -> bool
Check if this expression is a constant literal
Sourcepub fn is_variable(&self) -> bool
pub fn is_variable(&self) -> bool
Check if this expression is a simple variable reference
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Expression
impl Debug for Expression
Source§impl PartialEq for Expression
impl PartialEq for Expression
impl StructuralPartialEq for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
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