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
Empty
Boolean(bool)
Int(i64)
Float(f64)
Str(String)
List(Vec<Rc<Val>>)
Tuple(Vec<(Positioned<String>, Rc<Val>)>)
Macro(MacroDef)
Methods
impl Val
[src]
impl Val
pub fn type_name(&self) -> String
[src]
pub fn type_name(&self) -> String
Returns the Type of a Val as a string.
pub fn type_equal(&self, target: &Self) -> bool
[src]
pub fn type_equal(&self, target: &Self) -> bool
Returns 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) -> bool
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
pub fn is_float(&self) -> bool
[src]
pub fn is_float(&self) -> bool
pub fn is_string(&self) -> bool
[src]
pub fn is_string(&self) -> bool
pub fn is_tuple(&self) -> bool
[src]
pub fn is_tuple(&self) -> bool
pub fn is_list(&self) -> bool
[src]
pub fn is_list(&self) -> bool
pub fn is_macro(&self) -> bool
[src]
pub fn is_macro(&self) -> bool
Trait Implementations
impl PartialEq for Val
[src]
impl PartialEq for Val
fn eq(&self, other: &Val) -> bool
[src]
fn eq(&self, other: &Val) -> bool
This 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) -> bool
This method tests for !=
.
impl Debug for Val
[src]
impl Debug for Val
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Val
[src]
impl Clone for Val
fn clone(&self) -> Val
[src]
fn clone(&self) -> Val
Returns 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 Val
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl From<Val> for String
[src]
impl From<Val> for String
impl From<String> for Val
[src]
impl From<String> for Val