mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
start on roc_load build.rs script for building the builtins
This commit is contained in:
parent
7bb1fd88fa
commit
0a6335e772
4 changed files with 38 additions and 0 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -3673,7 +3673,11 @@ dependencies = [
|
||||||
name = "roc_load"
|
name = "roc_load"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"bumpalo",
|
||||||
|
"roc_builtins",
|
||||||
"roc_load_internal",
|
"roc_load_internal",
|
||||||
|
"roc_module",
|
||||||
|
"roc_target",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
interface Bool
|
||||||
|
exposes [ Bool, and, or, not, isEq, isNotEq ]
|
||||||
|
imports [ ]
|
||||||
|
|
||||||
Bool : [ True, False ]
|
Bool : [ True, False ]
|
||||||
|
|
||||||
and : Bool, Bool -> Bool
|
and : Bool, Bool -> Bool
|
||||||
|
|
|
@ -10,3 +10,8 @@ roc_load_internal = { path = "../load_internal" }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
roc_load_internal = { path = "../load_internal" }
|
roc_load_internal = { path = "../load_internal" }
|
||||||
|
roc_builtins = { path = "../builtins" }
|
||||||
|
roc_module = { path = "../module" }
|
||||||
|
bumpalo = { version = "3.8.0", features = ["collections"] }
|
||||||
|
roc_target = { path = "../roc_target" }
|
||||||
|
# roc_types = { path = "../types" }
|
||||||
|
|
|
@ -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
|
/// Main entry point to the compiler from the CLI and tests
|
||||||
pub fn load_and_monomorphize<'a>(
|
pub fn load_and_monomorphize<'a>(
|
||||||
arena: &'a Bump,
|
arena: &'a Bump,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue