[][src]Enum ucglib::build::ir::Val

pub enum Val {
    Empty,
    Boolean(bool),
    Int(i64),
    Float(f64),
    Str(String),
    List(Vec<Rc<Val>>),
    Tuple(Vec<(PositionedItem<String>, Rc<Val>)>),
    Env(Vec<(String, String)>),
    Macro(MacroDef),
    Module(ModuleDef),
}

The Intermediate representation of a compiled UCG AST.

Variants

EmptyBoolean(bool)Int(i64)Float(f64)Str(String)List(Vec<Rc<Val>>)Tuple(Vec<(PositionedItem<String>, Rc<Val>)>)Env(Vec<(String, String)>)Macro(MacroDef)Module(ModuleDef)

Methods

impl Val
[src]

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

Returns the Type of a Val as a string.

pub fn type_equal(&self, target: &Self) -> bool
[src]

Returns true if called with a Val of the same type as itself.

pub fn equal(&self, target: &Self, pos: Position) -> Result<bool, BuildError>
[src]

pub fn get_fields(&self) -> Option<&Vec<(PositionedItem<String>, Rc<Val>)>>
[src]

Returns the fields if this Val is a tuple. None otherwise.

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

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

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

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

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

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

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

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

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

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

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

Trait Implementations

impl From<Val> for String
[src]

impl From<String> for Val
[src]

impl PartialEq<Val> for Val
[src]

impl Clone for Val
[src]

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

Performs copy-assignment from source. Read more

impl Debug for Val
[src]

impl Display for Val
[src]

Auto Trait Implementations

impl !Send for Val

impl !Sync for Val

Blanket Implementations

impl<T> From for T
[src]

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

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

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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