mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
mark the builtin files as such so builtin function implementations are inserted
This commit is contained in:
parent
7c583b5e79
commit
493a96d85b
3 changed files with 21 additions and 11 deletions
|
@ -6,12 +6,12 @@ use roc_module::symbol::ModuleId;
|
|||
const MODULES: &[(ModuleId, &str)] = &[
|
||||
(ModuleId::BOOL, "Bool.roc"),
|
||||
(ModuleId::RESULT, "Result.roc"),
|
||||
(ModuleId::NUM, "Num.roc"),
|
||||
(ModuleId::LIST, "List.roc"),
|
||||
(ModuleId::STR, "Str.roc"),
|
||||
(ModuleId::DICT, "Dict.roc"),
|
||||
(ModuleId::SET, "Set.roc"),
|
||||
(ModuleId::BOX, "Box.roc"),
|
||||
(ModuleId::NUM, "Num.roc"),
|
||||
];
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -173,7 +173,6 @@ fn deserialize_help(bytes: &[u8]) -> (Subs, Vec<(Symbol, Variable)>) {
|
|||
fn read_cached_subs() -> MutMap<ModuleId, (Subs, Vec<(Symbol, Variable)>)> {
|
||||
let mut output = MutMap::default();
|
||||
|
||||
if false {
|
||||
output.insert(ModuleId::BOOL, deserialize_help(BOOL));
|
||||
output.insert(ModuleId::RESULT, deserialize_help(RESULT));
|
||||
output.insert(ModuleId::LIST, deserialize_help(LIST));
|
||||
|
@ -182,7 +181,6 @@ fn read_cached_subs() -> MutMap<ModuleId, (Subs, Vec<(Symbol, Variable)>)> {
|
|||
output.insert(ModuleId::SET, deserialize_help(SET));
|
||||
output.insert(ModuleId::BOX, deserialize_help(BOX));
|
||||
output.insert(ModuleId::NUM, deserialize_help(NUM));
|
||||
}
|
||||
|
||||
output
|
||||
}
|
||||
|
|
|
@ -3128,6 +3128,18 @@ fn send_header<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
// make sure when we run the bulitin modules in /compiler/builtins/roc that we
|
||||
// mark these modules as Builtin. Otherwise the builtin functions are not instantiated
|
||||
// and we just have a bunch of definitions with runtime errors in their bodies
|
||||
let extra = {
|
||||
match extra {
|
||||
HeaderFor::Interface if home.is_builtin() => HeaderFor::Builtin {
|
||||
generates_with: &[],
|
||||
},
|
||||
_ => extra,
|
||||
}
|
||||
};
|
||||
|
||||
(
|
||||
home,
|
||||
Msg::Header(ModuleHeader {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue