[][src]Enum axon_parser::ast::Expr

pub enum Expr {
    Add(Box<Add>),
    And(Box<And>),
    Cmp(Box<Cmp>),
    Div(Box<Div>),
    Eq(Box<Eq>),
    Gt(Box<Gt>),
    Gte(Box<Gte>),
    Lt(Box<Lt>),
    Lte(Box<Lte>),
    Mul(Box<Mul>),
    Ne(Box<Ne>),
    Or(Box<Or>),
    Sub(Box<Sub>),
    Assign(Assign),
    Block(Block),
    Call(Call),
    Def(Def),
    Dict(Dict),
    DotCall(DotCall),
    Func(Box<Func>),
    Id(TagName),
    If(Box<If>),
    List(List),
    Lit(Lit),
    Neg(Box<Neg>),
    Not(Box<Not>),
    PartialCall(PartialCall),
    Range(Box<Range>),
    Return(Box<Return>),
    Throw(Box<Throw>),
    TrapCall(Box<TrapCall>),
    TryCatch(Box<TryCatch>),
}

Enumerates the types of Axon expression.

Variants

Add(Box<Add>)
And(Box<And>)
Cmp(Box<Cmp>)
Div(Box<Div>)
Eq(Box<Eq>)
Gt(Box<Gt>)
Gte(Box<Gte>)
Lt(Box<Lt>)
Lte(Box<Lte>)
Mul(Box<Mul>)
Ne(Box<Ne>)
Or(Box<Or>)
Sub(Box<Sub>)
Assign(Assign)
Block(Block)
Call(Call)
Def(Def)
Dict(Dict)
DotCall(DotCall)
Func(Box<Func>)
If(Box<If>)
List(List)
Lit(Lit)
Neg(Box<Neg>)
Not(Box<Not>)
PartialCall(PartialCall)
Range(Box<Range>)
Return(Box<Return>)
Throw(Box<Throw>)
TrapCall(Box<TrapCall>)
TryCatch(Box<TryCatch>)

Implementations

impl Expr[src]

pub fn is_if(&self) -> bool[src]

pub fn is_block(&self) -> bool[src]

pub fn is_func(&self) -> bool[src]

pub fn precedence(&self) -> Option<u8>[src]

May return an int representing how high the expression's precendence is, where 1 is the highest precedence.

pub fn is_bin_op(&self) -> bool[src]

Returns true if this expression is a binary operation.

pub fn to_line(&self, indent: &Indent) -> Line[src]

pub fn to_lines(&self, indent: &Indent) -> Lines[src]

pub fn blockify(self) -> Self[src]

If the expression is not a block, wrap the expression in a block.

Trait Implementations

impl Clone for Expr[src]

impl Debug for Expr[src]

impl PartialEq<Expr> for Expr[src]

impl StructuralPartialEq for Expr[src]

impl TryFrom<&'_ Val> for Expr[src]

type Error = ()

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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, 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.