[−][src]Enum sixtyfps_compilerlib::expression_tree::Expression
The Expression is hold by properties, so it should not hold any strong references to node from the object_tree
Variants
Something went wrong (and an error will be reported)
Uncompiled(SyntaxNodeWithSourceFile)
We haven't done the lookup yet
TwoWayBinding(NamedReference)
Special expression that can be the value of a two way binding
StringLiteral(String)
A string literal. The .0 is the content of the string, without the quotes
Number
BoolLiteral(bool)
SignalReference(NamedReference)
Reference to the signal
Note: if we are to separate expression and statement, we probably do not need to have signal reference within expressions
PropertyReference(NamedReference)
Reference to the signal
BuiltinFunctionReference(BuiltinFunction)
Reference to a function built into the run-time, implemented natively
A MemberFunction expression exists only for a short time, for example for item.focus()
to be translated to
a regular FunctionCall expression where the base becomes the first argument.
Fields of MemberFunction
A reference to a specific element. This isn't possible to create in .60 syntax itself, but intermediate passes may generate this type of expression.
Reference to the index variable of a repeater
Example: idx
in for xxx[idx] in ...
. The element is the reference to the
element that is repeated
Reference to the model variable of a repeater
Example: xxx
in for xxx[idx] in ...
. The element is the reference to the
element that is repeated
Reference the parameter at the given index of the current function.
Should be directly within a CodeBlock expression, and store the value of the expression in a local variable
Fields of StoreLocalVariable
name: String
value: Box<Expression>
a reference to the local variable with the given name. The type system should ensure that a variable has been stored with this name and this type before in one of the statement of an enclosing codeblock
Access to a field of the given name within a object.
Fields of ObjectAccess
Cast an expression to the given type
Fields of Cast
from: Box<Expression>
to: Type
CodeBlock(Vec<Expression>)
a code block with different expression
A function call
Fields of FunctionCall
function: Box<Expression>
arguments: Vec<Expression>
A SelfAssignment or an Assignment. When op is '=' this is a signel assignment.
Fields of SelfAssignment
Fields of BinaryExpression
lhs: Box<Expression>
rhs: Box<Expression>
op: char
'+', '-', '/', '*', '=', '!', '<', '>', '≤', '≥', '&', '|'
Fields of UnaryOp
Fields of ResourceReference
absolute_source_path: String
Fields of Condition
Fields of Array
element_ty: Type
values: Vec<Expression>
Fields of Object
ty: Type
values: HashMap<String, Expression>
Fields of PathElements
elements: Path
EasingCurve(EasingCurve)
EnumerationValue(EnumerationValue)
Implementations
impl Expression
[src]
pub fn ty(&self) -> Type
[src]
Return the type of this property
pub fn visit(&self, visitor: impl FnMut(&Self))
[src]
Call the visitor for each sub-expression. (note: this function does not recurse)
pub fn visit_mut(&mut self, visitor: impl FnMut(&mut Self))
[src]
pub fn is_constant(&self) -> bool
[src]
pub fn maybe_convert_to(
self,
target_type: Type,
node: &impl SpannedWithSourceFile,
diag: &mut BuildDiagnostics
) -> Expression
[src]
self,
target_type: Type,
node: &impl SpannedWithSourceFile,
diag: &mut BuildDiagnostics
) -> Expression
Create a conversion node if needed, or throw an error if the type is not matching
pub fn default_value_for_type(ty: &Type) -> Expression
[src]
Return the default value for the given type
pub fn is_rw(&self) -> bool
[src]
Return true if the expression is a "lvalue" that can be used as the left hand side of a =
or +=
or similar
Trait Implementations
impl Clone for Expression
[src]
fn clone(&self) -> Expression
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Expression
[src]
impl Default for Expression
[src]
impl From<Expression> for ExpressionSpanned
[src]
fn from(expression: Expression) -> Self
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,