Skip to content

Commit

Permalink
refactor symbol insertion process
Browse files Browse the repository at this point in the history
  • Loading branch information
SpontanCombust committed Apr 19, 2024
1 parent 085bb26 commit 7bff636
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 146 deletions.
10 changes: 5 additions & 5 deletions crates/analysis/src/jobs/inject_native_symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn inject_primitives(symtab: &mut SymbolTable) {

].into_iter()
.for_each(|sym| {
symtab.insert(sym).unwrap();
symtab.insert(sym);
});
}

Expand Down Expand Up @@ -55,7 +55,7 @@ pub fn inject_globals(symtab: &mut SymbolTable) {
].into_iter()
.for_each(|(var_name, class_name)| {
let gv = GlobalVarSymbol::new(var_name, BasicTypeSymbolPath::new(class_name));
symtab.insert(gv).unwrap();
symtab.insert(gv);
});
}

Expand All @@ -70,7 +70,7 @@ pub fn inject_array_type(symtab: &mut SymbolTable, data_type_path: ArrayTypeSymb

let arr = ArrayTypeSymbol::new(data_type_path);
let (funcs, params) = arr.make_functions(&void_path, &int_path, &bool_path);
symtab.insert(arr).unwrap();
funcs.into_iter().for_each(|f| { symtab.insert(f).unwrap(); } );
params.into_iter().for_each(|p| { symtab.insert(p).unwrap(); } );
symtab.insert(arr);
funcs.into_iter().for_each(|f| { symtab.insert(f); } );
params.into_iter().for_each(|p| { symtab.insert(p); } );
}
Loading

0 comments on commit 7bff636

Please sign in to comment.