Enum lualite::ast::Expression
source · [−]pub enum Expression {
Identifier(Identifier),
Integer(IntegerLiteral),
Float(FloatLiteral),
Boolean(BooleanLiteral),
String(StringLiteral),
Unary {
op: UnaryOperator,
right: Box<Expression>,
},
Binary {
left: Box<Expression>,
op: BinaryOperator,
right: Box<Expression>,
},
FunctionCall {
left: Box<Expression>,
args: Vec<Expression>,
},
Index {
left: Box<Expression>,
index: Box<Expression>,
},
}
Expand description
Expression in a statement
Variants
Identifier(Identifier)
Identifier as an expression
Integer(IntegerLiteral)
Integer literal
Float(FloatLiteral)
Float literal
Boolean(BooleanLiteral)
Boolean literal
String(StringLiteral)
String literal
Unary
Unary prefix operator expressions
Binary
Fields
left: Box<Expression>
Left child expression
op: BinaryOperator
Binary operator
right: Box<Expression>
Right child expression
Binary operator expressions
FunctionCall
Fields
left: Box<Expression>
Callable expression (usually an identifier)
args: Vec<Expression>
List of expressions
Call a function with an argument list
Index
Fields
left: Box<Expression>
Container (i.e. arrays and hashmaps) to index
index: Box<Expression>
Index
Retrieve an element from a container
Trait Implementations
sourceimpl Clone for Expression
impl Clone for Expression
sourcefn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Expression
impl Debug for Expression
sourceimpl PartialEq<Expression> for Expression
impl PartialEq<Expression> for Expression
sourcefn eq(&self, other: &Expression) -> bool
fn eq(&self, other: &Expression) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Expression) -> bool
fn ne(&self, other: &Expression) -> bool
This method tests for !=
.
impl StructuralPartialEq for Expression
Auto Trait Implementations
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more