Enum ucglib::build::Val [−][src]
pub enum Val {
Empty,
Boolean(bool),
Int(i64),
Float(f64),
Str(String),
List(Vec<Rc<Val>>),
Tuple(Vec<(Positioned<String>, Rc<Val>)>),
Macro(MacroDef),
}The Intermediate representation of a compiled UCG AST.
Variants
EmptyBoolean(bool)Int(i64)Float(f64)Str(String)List(Vec<Rc<Val>>)Tuple(Vec<(Positioned<String>, Rc<Val>)>)Macro(MacroDef)
Methods
impl Val[src]
impl Valpub fn type_name(&self) -> String[src]
pub fn type_name(&self) -> StringReturns the Type of a Val as a string.
pub fn type_equal(&self, target: &Self) -> bool[src]
pub fn type_equal(&self, target: &Self) -> boolReturns true if called with a Val of the same type as itself.
pub fn equal(
&self,
target: &Self,
file_name: &str,
pos: Position
) -> Result<bool, Error>[src]
pub fn equal(
&self,
target: &Self,
file_name: &str,
pos: Position
) -> Result<bool, Error>pub fn get_fields(&self) -> Option<&Vec<(Positioned<String>, Rc<Val>)>>[src]
pub fn get_fields(&self) -> Option<&Vec<(Positioned<String>, Rc<Val>)>>Returns the fields if this Val is a tuple. None otherwise.
pub fn is_int(&self) -> bool[src]
pub fn is_int(&self) -> boolpub fn is_empty(&self) -> bool[src]
pub fn is_empty(&self) -> boolpub fn is_float(&self) -> bool[src]
pub fn is_float(&self) -> boolpub fn is_string(&self) -> bool[src]
pub fn is_string(&self) -> boolpub fn is_tuple(&self) -> bool[src]
pub fn is_tuple(&self) -> boolpub fn is_list(&self) -> bool[src]
pub fn is_list(&self) -> boolpub fn is_macro(&self) -> bool[src]
pub fn is_macro(&self) -> boolTrait Implementations
impl PartialEq for Val[src]
impl PartialEq for Valfn eq(&self, other: &Val) -> bool[src]
fn eq(&self, other: &Val) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Val) -> bool[src]
fn ne(&self, other: &Val) -> boolThis method tests for !=.
impl Debug for Val[src]
impl Debug for Valfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for Val[src]
impl Clone for Valfn clone(&self) -> Val[src]
fn clone(&self) -> ValReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0
[src]Performs copy-assignment from source. Read more
impl Display for Val[src]
impl Display for Valfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl From<Val> for String[src]
impl From<Val> for Stringimpl From<String> for Val[src]
impl From<String> for Val