[][src]Enum hatter::Stmt

pub enum Stmt {
    None,
    Value(Value),
    Word(Symbol),
    List(Vec<Stmt>),
    Map(Vec<(Symbol, Stmt)>),
    Call(Box<Stmt>, Vec<Stmt>),
    Return(Box<Stmt>),
    If(Vec<(Stmt, Vec<Stmt>)>),
    For(Option<Symbol>, SymbolBox<Stmt>, Vec<Stmt>),
    While(Box<Stmt>, Vec<Stmt>),
    Assign(SymbolBox<Stmt>, bool),
    Tag(Tag),
    Fn(Vec<Symbol>, Vec<Stmt>),
    Args(Vec<(Symbol, Stmt)>),
}

Stmt is an AST node.

Variants

None
Value(Value)
Word(Symbol)
List(Vec<Stmt>)
Call(Box<Stmt>, Vec<Stmt>)
Return(Box<Stmt>)
While(Box<Stmt>, Vec<Stmt>)
Assign(SymbolBox<Stmt>, bool)
Tag(Tag)
Fn(Vec<Symbol>, Vec<Stmt>)
Args(Vec<(Symbol, Stmt)>)

Implementations

impl Stmt[src]

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

Is this Stmt an actual statement?

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

Is this Stmt::None?

pub fn to_str(&self) -> &str[src]

If this is a String or a Word, get a &str of its literal value.

pub fn to_string(&self) -> String[src]

Create a String representation, for debug purposes.

Trait Implementations

impl Clone for Stmt[src]

impl Debug for Stmt[src]

impl<'_> From<&'_ str> for Stmt[src]

impl From<Stmt> for Value[src]

impl From<String> for Stmt[src]

impl From<Tag> for Stmt[src]

impl PartialEq<Stmt> for Stmt[src]

impl StructuralPartialEq for Stmt[src]

Auto Trait Implementations

impl !RefUnwindSafe for Stmt

impl !Send for Stmt

impl !Sync for Stmt

impl Unpin for Stmt

impl !UnwindSafe for Stmt

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.