* Visitors are now defined on a per-type level, allowing for greater flexibility in combining and re-using behavior * NameId is used for namespaces, which are used to index locally scoped variables. Syms are used for free namespaces, specifically in objects. All NameIDs are symbols, while not all symbols are NameIDs. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
32 lines
521 B
Rust
32 lines
521 B
Rust
#[macro_use] pub mod visit;
|
|
pub mod block;
|
|
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
|
|
}
|
|
}
|