a ton of stuff idk more ir work
This commit is contained in:
21
src/parser/v3/lower/module.rs
Normal file
21
src/parser/v3/lower/module.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use crate::ir::NamespaceGuard;
|
||||
|
||||
use super::{Module, ParserOutput};
|
||||
|
||||
impl Module {
|
||||
pub fn lower(&self, map: &mut NamespaceGuard, output: &mut ParserOutput) {
|
||||
let mut fns = Vec::new();
|
||||
for f in &self.functions {
|
||||
if let Some(id) = f.lower_header(map, output) {
|
||||
fns.push(Some(id));
|
||||
} else {
|
||||
fns.push(None)
|
||||
}
|
||||
}
|
||||
for (f, id) in self.functions.iter().zip(fns) {
|
||||
if let (Some(res), Some(id)) = (f.lower_body(map, output), id) {
|
||||
map.write_fn(id, res);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user