Enum dyon::ast::Expression

source ·
pub enum Expression {
Show 51 variants Link(Box<Link>), Object(Box<Object>), Array(Box<Array>), ArrayFill(Box<ArrayFill>), Return(Box<Expression>), ReturnVoid(Box<Range>), Break(Box<Break>), Continue(Box<Continue>), Block(Box<Block>), Go(Box<Go>), Call(Box<Call>), CallVoid(Box<CallVoid>), CallReturn(Box<CallReturn>), CallLazy(Box<CallLazy>), CallLoaded(Box<CallLoaded>), CallBinOp(Box<CallBinOp>), CallUnOp(Box<CallUnOp>), Item(Box<Item>), Assign(Box<Assign>), Vec4(Box<Vec4>), Mat4(Box<Mat4>), For(Box<For>), ForN(Box<ForN>), ForIn(Box<ForIn>), Sum(Box<ForN>), SumIn(Box<ForIn>), SumVec4(Box<ForN>), Prod(Box<ForN>), ProdIn(Box<ForIn>), ProdVec4(Box<ForN>), Min(Box<ForN>), MinIn(Box<ForIn>), Max(Box<ForN>), MaxIn(Box<ForIn>), Sift(Box<ForN>), SiftIn(Box<ForIn>), Any(Box<ForN>), AnyIn(Box<ForIn>), All(Box<ForN>), AllIn(Box<ForIn>), LinkFor(Box<ForN>), LinkIn(Box<ForIn>), If(Box<If>), Variable(Box<(Range, Variable)>), Try(Box<Expression>), Swizzle(Box<Swizzle>), Closure(Arc<Closure>), CallClosure(Box<CallClosure>), Grab(Box<Grab>), TryExpr(Box<TryExpr>), In(Box<In>),
}
Expand description

Expression.

Variants§

Link expression.

§

Object(Box<Object>)

Object expression.

§

Array(Box<Array>)

Array expression.

§

ArrayFill(Box<ArrayFill>)

Array fill expression.

§

Return(Box<Expression>)

Return expression.

§

ReturnVoid(Box<Range>)

Returns with value expression.

§

Break(Box<Break>)

Break expression.

§

Continue(Box<Continue>)

Continue expression.

§

Block(Box<Block>)

Block expression.

§

Go(Box<Go>)

Go call expression.

§

Call(Box<Call>)

Call expression.

§

CallVoid(Box<CallVoid>)

Call external function.

§

CallReturn(Box<CallReturn>)

Call external function that returns something.

§

CallLazy(Box<CallLazy>)

Call external function with lazy invariant.

§

CallLoaded(Box<CallLoaded>)

Call loaded function.

§

CallBinOp(Box<CallBinOp>)

Binary operator.

§

CallUnOp(Box<CallUnOp>)

Unary operator.

§

Item(Box<Item>)

Item expression.

§

Assign(Box<Assign>)

Assignment expression.

§

Vec4(Box<Vec4>)

4D vector expression.

§

Mat4(Box<Mat4>)

4D matrix expression.

§

For(Box<For>)

For expression, e.g. for i := 0; i < 10; i += 1 { ... }.

§

ForN(Box<ForN>)

For-n expression.

§

ForIn(Box<ForIn>)

For-in expression.

§

Sum(Box<ForN>)

Sum for-n expression.

§

SumIn(Box<ForIn>)

Sum-in for-n expression.

§

SumVec4(Box<ForN>)

Component-wise 4D vector sum for-n-loop.

§

Prod(Box<ForN>)

Product for-n expression.

§

ProdIn(Box<ForIn>)

Product-in for-n loop.

§

ProdVec4(Box<ForN>)

Component-wise 4D vector product for-n-loop.

§

Min(Box<ForN>)

Min for-n expression.

§

MinIn(Box<ForIn>)

Min-in for-n expression.

§

Max(Box<ForN>)

Max for-n expression.

§

MaxIn(Box<ForIn>)

Max-in for-n expression.

§

Sift(Box<ForN>)

Sift for-n expression.

§

SiftIn(Box<ForIn>)

Sift-in expression.

§

Any(Box<ForN>)

Any expression.

§

AnyIn(Box<ForIn>)

Any-in expression.

§

All(Box<ForN>)

All-for expression.

§

AllIn(Box<ForIn>)

All-in expression.

§

LinkFor(Box<ForN>)

Link-for expression.

§

LinkIn(Box<ForIn>)

Link-in expression.

§

If(Box<If>)

If-expression.

§

Variable(Box<(Range, Variable)>)

Variable.

This means it contains no members that depends on other expressions.

§

Try(Box<Expression>)

Try expression using ?.

§

Swizzle(Box<Swizzle>)

4D vector swizzle expression.

§

Closure(Arc<Closure>)

Closure expression.

§

CallClosure(Box<CallClosure>)

Call closure expression.

§

Grab(Box<Grab>)

Grab expression.

§

TryExpr(Box<TryExpr>)

Try expression, e.g. try x.

§

In(Box<In>)

In-type expression.

Implementations§

source§

impl Expression

source

pub fn from_meta_data( file: &Arc<String>, source: &Arc<String>, node: &str, convert: Convert<'_>, ignored: &mut Vec<Range> ) -> Result<(Range, Expression), ()>

Creates expression from meta data.

source

pub fn source_range(&self) -> Range

Gets the range in source.

Trait Implementations§

source§

impl Clone for Expression

source§

fn clone(&self) -> Expression

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Expression

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Sync for Expression

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Err = <U as TryFrom<T>>::Err

§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Err>