Enum ucglib::build::Val
[−]
[src]
pub enum Val {
Empty,
Int(i64),
Float(f64),
String(String),
List(Vec<Rc<Val>>),
Tuple(Vec<(Positioned<String>, Rc<Val>)>),
Macro(MacroDef),
}The Intermediate representation of a compiled UCG AST.
Variants
EmptyInt(i64)Float(f64)String(String)List(Vec<Rc<Val>>)Tuple(Vec<(Positioned<String>, Rc<Val>)>)Macro(MacroDef)
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 get_fields(&self) -> Option<&Vec<(Positioned<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_list(&self) -> bool[src]
pub fn is_macro(&self) -> bool[src]
Trait Implementations
impl PartialEq for Val[src]
fn eq(&self, __arg_0: &Val) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Val) -> bool[src]
This method tests for !=.
impl Debug for Val[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl Clone for Val[src]
fn clone(&self) -> Val[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Display for Val[src]
fn fmt(&self, f: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more