diff --git a/src/value.rs b/src/value.rs index e280472..66c6572 100644 --- a/src/value.rs +++ b/src/value.rs @@ -12,6 +12,7 @@ pub enum Value<'a> { List(Box>), Vector(Vec), Map(BTreeMap), + Module(Module<'a>), Symbol(Symbol<'a>), Keyword(Cow<'a, str>), Function { @@ -44,6 +45,12 @@ impl<'a> Display for Symbol<'a> { } } +#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] +pub struct Module<'a> { + members: BTreeMap>, + symbol_table: BTreeMap, +} + impl<'a> Display for Value<'a> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { @@ -55,6 +62,7 @@ impl<'a> Display for Value<'a> { "[", "]", ), + Value::Module(_) => write!(f, "#module#"), Value::Symbol(sym) => write!(f, "{sym}"), Value::Keyword(kw) => write!(f, ":{kw}"), Value::Function { .. } => write!(f, "fn"),