Enum bobascript_parser::ast::Expr[][src]

pub enum Expr {
    Error,
    Log(Box<Expr>),
    Block(Vec<Box<Stmt>>, Option<Box<Expr>>),
    If(Box<Expr>, Box<Expr>, Option<Box<Expr>>),
    While(Box<Expr>, Vec<Box<Stmt>>),
    Assign(Box<Expr>, AssignOpBox<Expr>),
    Binary(Box<Expr>, BinaryOpBox<Expr>),
    Unary(UnaryOpBox<Expr>),
    Property(Box<Expr>, String),
    Index(Box<Expr>, Box<Expr>),
    Call(Box<Expr>, Vec<Box<Expr>>),
    Constant(Constant),
}

Variants

Error
Log(Box<Expr>)

Outputs the value of the contained Expr as a log.

Block(Vec<Box<Stmt>>, Option<Box<Expr>>)
If(Box<Expr>, Box<Expr>, Option<Box<Expr>>)

The first Expr is the condition, the second the “true” block, and the third the “false” block.

Else-if statements are collapsed as if a standard if statement was put inside of the else block.

While(Box<Expr>, Vec<Box<Stmt>>)

While Expr is true, do Stmts.

Assign(Box<Expr>, AssignOpBox<Expr>)
Binary(Box<Expr>, BinaryOpBox<Expr>)
Unary(UnaryOpBox<Expr>)
Property(Box<Expr>, String)
Index(Box<Expr>, Box<Expr>)
Call(Box<Expr>, Vec<Box<Expr>>)
Constant(Constant)

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.