Spread out implementations of symbol and attrs-related things, add impl

blocks for TranslateAst

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-05-21 18:51:54 -04:00
parent 926447a62d
commit 7b470b1e76
14 changed files with 178 additions and 114 deletions

View File

@@ -8,31 +8,15 @@ use crate::{
};
use std::rc::Rc;
/*
fn root_ns<I: Intern, G: Gc>(intern: &mut I, gc: &mut G) -> Ns {
let mut ns: Ns = Default::default();
ns.insert(
intern.intern_sym("Unit"),
Attrs::new(gc, Default::default()),
);
ns
}
*/
pub struct State<I: Intern, G: Gc> {
intern: I,
pub struct State<G: Gc> {
gc: G,
root_ns: Ns,
frames: Vec<Frame>,
}
impl<I: Intern, G: Gc> State<I, G> {
pub fn new(intern: I, gc: G, root_ns: Ns) -> Self {
//let root_ns = root_ns(&mut intern, &mut gc);
impl<G: Gc> State<G> {
pub fn new(gc: G) -> Self {
State {
intern,
gc,
root_ns,
frames: Default::default(),
}
}