pub enum Val {
Empty,
Boolean(bool),
Int(i64),
Float(f64),
Str(String),
List(Vec<Rc<Val>>),
Tuple(Vec<(String, Rc<Val>)>),
Env(Vec<(String, String)>),
}
Expand description
The Intermediate representation of a compiled UCG AST.
Variants§
Empty
Boolean(bool)
Int(i64)
Float(f64)
Str(String)
List(Vec<Rc<Val>>)
Tuple(Vec<(String, Rc<Val>)>)
Env(Vec<(String, String)>)
Implementations§
Source§impl Val
impl Val
Sourcepub fn type_equal(&self, target: &Self) -> bool
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) -> Result<bool, BuildError>
Sourcepub fn get_fields(&self) -> Option<&Vec<(String, Rc<Val>)>>
pub fn get_fields(&self) -> Option<&Vec<(String, Rc<Val>)>>
Returns the fields if this Val is a tuple. None otherwise.
pub fn is_int(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn is_float(&self) -> bool
pub fn is_string(&self) -> bool
pub fn is_tuple(&self) -> bool
pub fn is_env(&self) -> bool
pub fn is_list(&self) -> bool
pub fn is_bool(&self) -> bool
pub fn is_str(&self) -> bool
Trait Implementations§
impl StructuralPartialEq for Val
Auto Trait Implementations§
impl Freeze for Val
impl RefUnwindSafe for Val
impl !Send for Val
impl !Sync for Val
impl Unpin for Val
impl UnwindSafe for Val
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more