Introduce notion of RuntimeValue

This commit is contained in:
Greg Shuflin 2021-10-25 19:34:05 -07:00
parent ec8ae05018
commit 0a2f06f598

View File

@ -127,6 +127,24 @@ impl MemoryValue {
}
}
#[derive(Debug)]
enum RuntimeValue {
Expression(Expression),
Evaluated(Primitive),
}
impl From<Expression> for RuntimeValue {
fn from(expr: Expression) -> Self {
Self::Expression(expr)
}
}
impl From<Primitive> for RuntimeValue {
fn from(prim: Primitive) -> Self {
Self::Evaluated(prim)
}
}
/// A fully-reduced value
#[derive(Debug, Clone)]
enum Primitive {