about summary refs log blame commit diff
path: root/users/tazjin/rlox/src/bytecode/value.rs
blob: c6667a698ec9a5fc470c384f00e33eed9fc9e92c (plain) (tree)
1
2
3
4
5
6
7




                                  
                   
 









                                       
#[derive(Clone, Debug, PartialEq)]
pub enum Value {
    Nil,
    Bool(bool),
    Number(f64),
    String(String),
}

impl Value {
    pub fn is_falsey(&self) -> bool {
        match self {
            Value::Nil => true,
            Value::Bool(false) => true,
            _ => false,
        }
    }
}