Move compile::Ctx to its own mod, compile::ctx::Ctx

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-05-20 14:51:30 -04:00
parent 9439dfda87
commit 499e09b254
6 changed files with 43 additions and 27 deletions

View File

@@ -1,31 +1,11 @@
#[macro_use] pub mod visit;
pub mod block;
pub mod ctx;
pub mod error;
pub mod ir;
pub mod name;
use crate::compile::name::NameStack;
// * Desugar
// * Collect names as symbols
// * Create basic blocks
pub struct Ctx {
name_stack: NameStack,
}
impl Ctx {
pub fn new() -> Self {
Ctx {
name_stack: NameStack::new(),
}
}
pub fn name_stack(&self) -> &NameStack {
&self.name_stack
}
pub fn name_stack_mut(&mut self) -> &mut NameStack {
&mut self.name_stack
}
}