start on roc_load build.rs script for building the builtins

This commit is contained in:
Folkert 2022-03-23 18:30:43 +01:00
parent 7bb1fd88fa
commit 0a6335e772
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
4 changed files with 38 additions and 0 deletions

View file

@ -832,6 +832,31 @@ pub fn load_and_typecheck<'a>(
}
}
pub fn load_and_typecheck_str<'a>(
arena: &'a Bump,
filename: PathBuf,
source: &'a str,
src_dir: &Path,
exposed_types: ExposedByModule,
target_info: TargetInfo,
) -> Result<LoadedModule, LoadingProblem<'a>> {
use LoadResult::*;
let load_start = LoadStart::from_str(arena, filename, source)?;
match load(
arena,
load_start,
src_dir,
exposed_types,
Phase::SolveTypes,
target_info,
)? {
Monomorphized(_) => unreachable!(""),
TypeChecked(module) => Ok(module),
}
}
/// Main entry point to the compiler from the CLI and tests
pub fn load_and_monomorphize<'a>(
arena: &'a Bump,