pub mod block; pub mod error; pub mod ir; pub mod name; pub mod visit; use crate::compile::name::NameStack; // * Desugar // * Collect names as symbols // * Create basic blocks pub struct Ctx<'t> { text: &'t str, name_stack: NameStack, } impl<'t> Ctx<'t> { pub fn new(text: &'t str) -> Self { Ctx { text, name_stack: NameStack::new(), } } pub fn text(&self) -> &'t str { self.text } pub fn name_stack(&self) -> &NameStack { &self.name_stack } pub fn name_stack_mut(&mut self) -> &mut NameStack { &mut self.name_stack } } // no sugar in the syntax quite yet /* pub struct Desugar; impl Pass> for Desugar { type Out = Vec; fn pass(&mut self, input: Vec) -> Vec { input } } */