reorg
This commit is contained in:
parent
ee6c092577
commit
91bbdf0b37
19
src/value.rs
19
src/value.rs
|
@ -13,17 +13,24 @@ pub enum Value<'a> {
|
||||||
Vector(Vec<Self>),
|
Vector(Vec<Self>),
|
||||||
Map(BTreeMap<Self, Self>),
|
Map(BTreeMap<Self, Self>),
|
||||||
Module(Module<'a>),
|
Module(Module<'a>),
|
||||||
|
Function(Function),
|
||||||
Symbol(Symbol<'a>),
|
Symbol(Symbol<'a>),
|
||||||
Keyword(Cow<'a, str>),
|
Keyword(Cow<'a, str>),
|
||||||
Function {
|
|
||||||
// TODO: Fields,
|
|
||||||
},
|
|
||||||
Bool(bool),
|
Bool(bool),
|
||||||
Number(OrderedFloat<f64>),
|
Number(OrderedFloat<f64>),
|
||||||
String(Cow<'a, str>),
|
String(Cow<'a, str>),
|
||||||
Nil,
|
Nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
|
pub struct Module<'a> {
|
||||||
|
members: BTreeMap<u64, Value<'a>>,
|
||||||
|
symbol_table: BTreeMap<String, u64>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
|
pub struct Function {}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub enum Symbol<'a> {
|
pub enum Symbol<'a> {
|
||||||
Interned(u64),
|
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<u64, Value<'a>>,
|
|
||||||
symbol_table: BTreeMap<String, u64>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> Display for Value<'a> {
|
impl<'a> Display for Value<'a> {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
|
|
Loading…
Reference in a new issue