From 91bbdf0b37fc0b1b35619d590f8e1d98815e4405 Mon Sep 17 00:00:00 2001 From: Erin Date: Thu, 21 Jul 2022 19:25:33 +0200 Subject: [PATCH] reorg --- src/value.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/value.rs b/src/value.rs index 66c6572..0d785aa 100644 --- a/src/value.rs +++ b/src/value.rs @@ -13,17 +13,24 @@ pub enum Value<'a> { Vector(Vec), Map(BTreeMap), Module(Module<'a>), + Function(Function), Symbol(Symbol<'a>), Keyword(Cow<'a, str>), - Function { - // TODO: Fields, - }, Bool(bool), Number(OrderedFloat), String(Cow<'a, str>), Nil, } +#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] +pub struct Module<'a> { + members: BTreeMap>, + symbol_table: BTreeMap, +} + +#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] +pub struct Function {} + #[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] pub enum Symbol<'a> { Interned(u64), @@ -45,12 +52,6 @@ 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 {