[][src]Enum chrysanthemum::ast::Expr

pub enum Expr {
    UniOp(UOpBox<Expr>),
    BinOp(OpBox<Expr>, Box<Expr>),
    FunCall(StringExprs),
    If(Box<Expr>, ExprsExprs),
    Let(PatternTypeBox<Expr>),
    Structure(StringVec<(String, Expr)>),
    Literal(Lit),
    Var(String),
    StructRef(Box<Expr>, String),
    Match(Box<Expr>, Vec<(Pattern, Exprs)>),
    Block(Exprs),
}

Expression that returns a value.

Variants

UniOp(UOpBox<Expr>)

Unary operation

BinOp(OpBox<Expr>, Box<Expr>)

Binary operation

FunCall(StringExprs)

Function call

If(Box<Expr>, ExprsExprs)

If-else expression. Right now, else is required, elif is nonexistent. Case, if-body, else-body.

Let(PatternTypeBox<Expr>)

Variable binding -- returns () Var name, type, initializer

Structure(StringVec<(String, Expr)>)

Structure creation Name, fields with initializers

Literal(Lit)

Raw value

Var(String)

Variable reference

StructRef(Box<Expr>, String)

Structure member reference

Match(Box<Expr>, Vec<(Pattern, Exprs)>)

Match expression

Block(Exprs)

A block, combining multiple expr's together into a scope. The value of the last expression is returned.

Trait Implementations

impl Clone for Expr[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<Expr> for Expr[src]

impl Debug for Expr[src]

impl Serialize for Expr[src]

impl<'de> Deserialize<'de> for Expr[src]

Auto Trait Implementations

impl Sync for Expr

impl Unpin for Expr

impl Send for Expr

impl UnwindSafe for Expr

impl RefUnwindSafe for Expr

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]