pub enum Expr {
Literal(Literal),
Logical(LogicalData),
Unary(UnaryData),
Binary(BinaryData),
Grouping(GroupingData),
Variable(VariableData),
Assign(AssignData),
Call(CallData),
Get(GetData),
Set(SetData),
This(ThisData),
Super(SuperData),
}Expand description
Represents an expression in the language.
Variants§
Literal(Literal)
A literal value.
1"hello"truenull
Logical(LogicalData)
A logical expression.
true and false1 or "hello"
Unary(UnaryData)
An unary expression.
-1!true
Binary(BinaryData)
A binary expression.
1 + 21 != 21 <= 21 / 2
Grouping(GroupingData)
A grouping expression.
(1 + 2)(true and false) or (1 <= 2)((1 + 2) * 3) / 4
Variable(VariableData)
A variable expression.
x
Assign(AssignData)
An assignment expression.
x = 1x = "hello"x = func()
Call(CallData)
A call expression.
func()func(arg1, 23)instance.method()
Get(GetData)
A get expression.
instance.propertyinstance.property.method()
Set(SetData)
A set expression.
instance.property = 1instance.property = "hello"
This(ThisData)
A this expression.
thisthis.property
Super(SuperData)
A super expression.
super.method()super.method(arg1, 23)
Implementations§
Trait Implementations§
impl Eq for Expr
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 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