Enum full_moon::ast::Expression
source · [−]#[non_exhaustive]
pub enum Expression {
BinaryOperator {
lhs: Box<Expression>,
binop: BinOp,
rhs: Box<Expression>,
},
Parentheses {
contained: ContainedSpan,
expression: Box<Expression>,
},
UnaryOperator {
unop: UnOp,
expression: Box<Expression>,
},
Value {
value: Box<Value>,
type_assertion: Option<TypeAssertion>,
},
}
Expand description
An expression, mostly useful for getting values
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
BinaryOperator
Fields
lhs: Box<Expression>
The left hand side of the binary operation, the 1
part of 1 + 3
binop: BinOp
The binary operation used, the +
part of 1 + 3
rhs: Box<Expression>
The right hand side of the binary operation, the 3
part of 1 + 3
A binary operation, such as 1 + 3
Parentheses
Fields
contained: ContainedSpan
The parentheses of the ParenExpression
expression: Box<Expression>
The expression inside the parentheses
A statement in parentheses, such as (#list)
UnaryOperator
Fields
unop: UnOp
The unary operation, the #
part of #list
expression: Box<Expression>
The expression the operation is being done on, the list
part of #list
A unary operation, such as #list
Value
Fields
type_assertion: Option<TypeAssertion>
What the value is being asserted as using ::
.
Only available when the “roblox” feature flag is enabled.
A value, such as “strings”
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<'de> Deserialize<'de> for Expression
impl<'de> Deserialize<'de> for Expression
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for Expression
impl Display for Expression
sourceimpl Node for Expression
impl Node for Expression
sourcefn start_position(&self) -> Option<Position>
fn start_position(&self) -> Option<Position>
The start position of a node. None if can’t be determined
sourcefn end_position(&self) -> Option<Position>
fn end_position(&self) -> Option<Position>
The end position of a node. None if it can’t be determined
sourcefn similar(&self, other: &Self) -> bool
fn similar(&self, other: &Self) -> bool
Whether another node of the same type is the same as this one semantically, ignoring position
sourcefn tokens<'a>(&'a self) -> Tokens<'a>ⓘNotable traits for Tokens<'a>impl<'a> Iterator for Tokens<'a> type Item = &'a TokenReference;
fn tokens<'a>(&'a self) -> Tokens<'a>ⓘNotable traits for Tokens<'a>impl<'a> Iterator for Tokens<'a> type Item = &'a TokenReference;
The token references that comprise a node
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 !=
.
sourceimpl Serialize for Expression
impl Serialize for Expression
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 · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more