forked from M-Labs/nac3
core: refactor top_level::builtins::get_builtins()
This commit is contained in:
parent
ce3e9bf4fe
commit
e85f4f9bd2
|
@ -269,14 +269,15 @@ fn create_fn_by_extern(
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_builtins(unifier: &mut Unifier, primitives: &PrimitiveStore) -> BuiltinInfo {
|
pub fn get_builtins(unifier: &mut Unifier, primitives: &PrimitiveStore) -> BuiltinInfo {
|
||||||
let top_level_def_list = BuiltinBuilder::new(unifier, primitives)
|
BuiltinBuilder::new(unifier, primitives)
|
||||||
.build_all_builtins()
|
.build_all_builtins()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|tld| Arc::new(RwLock::new(tld)));
|
.map(|tld| {
|
||||||
|
let tld = Arc::new(RwLock::new(tld));
|
||||||
let ast_list: Vec<Option<Stmt<()>>> = (0..top_level_def_list.len()).map(|_| None).collect();
|
let ast = None;
|
||||||
|
(tld, ast)
|
||||||
izip!(top_level_def_list, ast_list).collect_vec()
|
})
|
||||||
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A helper enum used by [`BuiltinBuilder`]
|
/// A helper enum used by [`BuiltinBuilder`]
|
||||||
|
|
|
@ -20,7 +20,7 @@ use crate::{
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use inkwell::values::BasicValueEnum;
|
use inkwell::values::BasicValueEnum;
|
||||||
use itertools::{izip, Itertools};
|
use itertools::Itertools;
|
||||||
use nac3parser::ast::{self, Location, Stmt, StrRef};
|
use nac3parser::ast::{self, Location, Stmt, StrRef};
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue