new approach for defining our builtins

This commit is contained in:
Folkert 2022-07-08 02:51:04 +02:00
parent 98c55ba30c
commit 41768bfa97
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
11 changed files with 450 additions and 8 deletions

View file

@ -1,7 +1,7 @@
use std::path::PathBuf;
use bumpalo::Bump;
use roc_load_internal::file::Threading;
use roc_load_internal::file::{LoadingProblem, Threading};
use roc_module::symbol::ModuleId;
const MODULES: &[(ModuleId, &str)] = &[
@ -47,7 +47,16 @@ fn write_subs_for_module(module_id: ModuleId, filename: &str) {
Threading::AllAvailable,
);
let module = res_module.unwrap();
let module = match res_module {
Ok(v) => v,
Err(LoadingProblem::FormattedReport(report)) => {
panic!("{}", report);
}
Err(other) => {
panic!("build_file failed with error:\n{:?}", other);
}
};
let subs = module.solved.inner();
let exposed_vars_by_symbol: Vec<_> = module.exposed_to_host.into_iter().collect();