From 0a2f06f5985568170aeb36c0475b79df5bac80c1 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Mon, 25 Oct 2021 19:34:05 -0700 Subject: [PATCH] Introduce notion of RuntimeValue --- schala-lang/language/src/tree_walk_eval/mod.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/schala-lang/language/src/tree_walk_eval/mod.rs b/schala-lang/language/src/tree_walk_eval/mod.rs index d0f376a..cb8c899 100644 --- a/schala-lang/language/src/tree_walk_eval/mod.rs +++ b/schala-lang/language/src/tree_walk_eval/mod.rs @@ -127,6 +127,24 @@ impl MemoryValue { } } +#[derive(Debug)] +enum RuntimeValue { + Expression(Expression), + Evaluated(Primitive), +} + +impl From for RuntimeValue { + fn from(expr: Expression) -> Self { + Self::Expression(expr) + } +} + +impl From for RuntimeValue { + fn from(prim: Primitive) -> Self { + Self::Evaluated(prim) + } +} + /// A fully-reduced value #[derive(Debug, Clone)] enum Primitive {