mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-16 14:49:03 +00:00
Fix Bool index in Bool.roc
This commit is contained in:
parent
5916742443
commit
fe215a452d
2 changed files with 8 additions and 3 deletions
|
@ -46,14 +46,13 @@ pub fn main() !void {
|
||||||
const set_roc_source = try std.fs.cwd().readFileAlloc(gpa, "src/build/roc/Set.roc", 1024 * 1024);
|
const set_roc_source = try std.fs.cwd().readFileAlloc(gpa, "src/build/roc/Set.roc", 1024 * 1024);
|
||||||
defer gpa.free(set_roc_source);
|
defer gpa.free(set_roc_source);
|
||||||
|
|
||||||
// Compile Bool.roc without injecting Bool (it defines Bool itself)
|
// Compile Bool.roc without injecting anything (it's completely self-contained)
|
||||||
// We still inject Result since Bool.roc might use it
|
|
||||||
const bool_env = try compileModule(
|
const bool_env = try compileModule(
|
||||||
gpa,
|
gpa,
|
||||||
"Bool",
|
"Bool",
|
||||||
bool_roc_source,
|
bool_roc_source,
|
||||||
&.{}, // No module dependencies
|
&.{}, // No module dependencies
|
||||||
.{ .inject_bool = false, .inject_result = true },
|
.{ .inject_bool = false, .inject_result = false },
|
||||||
);
|
);
|
||||||
defer {
|
defer {
|
||||||
bool_env.deinit();
|
bool_env.deinit();
|
||||||
|
|
|
@ -171,8 +171,14 @@ pub fn deinit(
|
||||||
self.scratch_free_vars.deinit(gpa);
|
self.scratch_free_vars.deinit(gpa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Options for initializing the canonicalizer.
|
||||||
|
/// Controls which built-in types are injected into the module's scope.
|
||||||
pub const InitOptions = struct {
|
pub const InitOptions = struct {
|
||||||
|
/// Whether to inject the Bool type declaration (`Bool := [True, False]`).
|
||||||
|
/// Set to false when compiling Bool.roc itself to avoid duplication.
|
||||||
inject_bool: bool = true,
|
inject_bool: bool = true,
|
||||||
|
/// Whether to inject the Result type declaration (`Result(ok, err) := [Ok(ok), Err(err)]`).
|
||||||
|
/// Set to false when compiling Result.roc itself (if it exists).
|
||||||
inject_result: bool = true,
|
inject_result: bool = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue