Merge branch 'main' into constrain-early-return-functions

This commit is contained in:
Sam Mohr 2024-11-18 15:04:34 -08:00
commit 7ca305b5dc
No known key found for this signature in database
GPG key ID: EA41D161A3C1BC99
371 changed files with 6427 additions and 8505 deletions

View file

@ -616,7 +616,6 @@ fn stmt_spec<'a>(
}
Dbg { remainder, .. } => stmt_spec(builder, interner, env, block, layout, remainder),
Expect { remainder, .. } => stmt_spec(builder, interner, env, block, layout, remainder),
ExpectFx { remainder, .. } => stmt_spec(builder, interner, env, block, layout, remainder),
Ret(symbol) => Ok(env.symbols[symbol]),
Refcounting(modify_rc, continuation) => {
apply_refcount_operation(builder, env, block, modify_rc)?;

View file

@ -42,29 +42,6 @@ pub fn link(
}
}
/// Same format as the precompiled host filename, except with a file extension like ".o" or ".obj"
pub fn legacy_host_file(target: Target, platform_main_roc: &Path) -> PathBuf {
let lib_ext = target.static_library_file_ext();
let file_name = roc_linker::preprocessed_host_filename(target)
.replace(roc_linker::PRECOMPILED_HOST_EXT, lib_ext);
let lib_path = platform_main_roc.with_file_name(file_name);
let default_host_path: PathBuf = platform_main_roc
.with_file_name("libhost")
.with_extension(lib_ext);
if lib_path.exists() {
lib_path
} else if default_host_path.exists() {
default_host_path
} else {
let obj_ext = target.object_file_ext();
lib_path.with_extension(obj_ext)
}
}
// Attempts to find a file that is stored relative to the roc executable.
// Since roc is built in target/debug/roc, we may need to drop that path to find the file.
// This is used to avoid depending on the current working directory.
@ -457,6 +434,7 @@ pub fn rebuild_host(
};
let host_dest = if matches!(target.architecture(), Architecture::Wasm32) {
// TODO verify this is corect, how do we do get here with OptLevel::Development
if matches!(opt_level, OptLevel::Development) {
platform_main_roc.with_extension("o")
} else {
@ -467,7 +445,7 @@ pub fn rebuild_host(
.with_file_name("dynhost")
.with_extension(executable_extension)
} else {
legacy_host_file(target, platform_main_roc)
platform_main_roc.with_file_name(target.prebuilt_static_object())
};
let env_path = env::var("PATH").unwrap_or_else(|_| "".to_string());
@ -1352,9 +1330,9 @@ pub fn llvm_module_to_dylib(
unsafe { Library::new(path) }
}
pub fn preprocess_host_wasm32(host_input_path: &Path, preprocessed_host_path: &Path) {
pub fn preprocess_host_wasm32(host_input_path: &Path, host_output_path: &Path) {
let host_input = host_input_path.to_str().unwrap();
let output_file = preprocessed_host_path.to_str().unwrap();
let output_file = host_output_path.to_str().unwrap();
/*
Notes:
@ -1400,9 +1378,11 @@ pub fn preprocess_host_wasm32(host_input_path: &Path, preprocessed_host_path: &P
fn run_build_command(mut command: Command, file_to_build: &str, flaky_fail_counter: usize) {
let command_string = stringify_command(&command, false);
let cmd_str = &command_string;
roc_debug_flags::dbg_do!(roc_debug_flags::ROC_PRINT_BUILD_COMMANDS, {
print_command_str(cmd_str);
});
let cmd_output = command.output().unwrap();
let max_flaky_fail_count = 10;

View file

@ -1,6 +1,4 @@
use crate::link::{
legacy_host_file, link, preprocess_host_wasm32, rebuild_host, LinkType, LinkingStrategy,
};
use crate::link::{link, preprocess_host_wasm32, rebuild_host, LinkType, LinkingStrategy};
use bumpalo::collections::CollectIn;
use bumpalo::Bump;
use inkwell::memory_buffer::MemoryBuffer;
@ -28,6 +26,7 @@ use std::{
#[cfg(feature = "target-wasm32")]
use roc_collections::all::MutSet;
use roc_target::SurgicalHostArtifacts;
pub const DEFAULT_ROC_FILENAME: &str = "main.roc";
@ -97,7 +96,7 @@ pub fn gen_from_mono_module<'a>(
roc_file_path: &Path,
target: Target,
code_gen_options: CodeGenOptions,
preprocessed_host_path: &Path,
built_host_opt: &BuiltHostOpt,
wasm_dev_stack_bytes: Option<u32>,
) -> GenFromMono<'a> {
let path = roc_file_path;
@ -107,19 +106,27 @@ pub fn gen_from_mono_module<'a>(
let opt = code_gen_options.opt_level;
match code_gen_options.backend {
CodeGenBackend::Wasm => gen_from_mono_module_dev(
arena,
loaded,
target,
preprocessed_host_path,
wasm_dev_stack_bytes,
AssemblyBackendMode::Binary, // dummy value, unused in practice
),
CodeGenBackend::Wasm => {
assert_ne!(
*built_host_opt,
BuiltHostOpt::None,
"Wasm backend needs a built host."
);
gen_from_mono_module_dev(
arena,
loaded,
target,
built_host_opt,
wasm_dev_stack_bytes,
AssemblyBackendMode::Binary, // dummy value, unused in practice
)
}
CodeGenBackend::Assembly(backend_mode) => gen_from_mono_module_dev(
arena,
loaded,
target,
preprocessed_host_path,
built_host_opt,
wasm_dev_stack_bytes,
backend_mode,
),
@ -430,43 +437,59 @@ fn gen_from_mono_module_llvm<'a>(
)
}
#[cfg(feature = "target-wasm32")]
fn gen_from_mono_module_dev<'a>(
arena: &'a bumpalo::Bump,
loaded: MonomorphizedModule<'a>,
target: Target,
preprocessed_host_path: &Path,
built_host_opt: &BuiltHostOpt,
wasm_dev_stack_bytes: Option<u32>,
backend_mode: AssemblyBackendMode,
#[allow(unused_variables)] backend_mode: AssemblyBackendMode,
) -> GenFromMono<'a> {
match target.architecture() {
Architecture::Wasm32 => gen_from_mono_module_dev_wasm32(
arena,
loaded,
preprocessed_host_path,
wasm_dev_stack_bytes,
),
Architecture::X86_64 | Architecture::Aarch64 => {
gen_from_mono_module_dev_assembly(arena, loaded, target, backend_mode)
}
_ => todo!(),
}
}
match (built_host_opt, target.architecture()) {
(BuiltHostOpt::Additive(host_path), Architecture::Wasm32) => {
#[cfg(feature = "target-wasm32")]
{
gen_from_mono_module_dev_wasm32(arena, loaded, host_path, wasm_dev_stack_bytes)
}
#[cfg(not(feature = "target-wasm32"))]
pub fn gen_from_mono_module_dev<'a>(
arena: &'a bumpalo::Bump,
loaded: MonomorphizedModule<'a>,
target: Target,
_host_input_path: &Path,
_wasm_dev_stack_bytes: Option<u32>,
backend_mode: AssemblyBackendMode,
) -> GenFromMono<'a> {
match target.architecture() {
Architecture::X86_64 | Architecture::Aarch64 => {
gen_from_mono_module_dev_assembly(arena, loaded, target, backend_mode)
#[cfg(not(feature = "target-wasm32"))]
{
internal_error!("Compiler was not built with feature 'target-wasm32'.");
}
}
(BuiltHostOpt::None, Architecture::Wasm32) => {
internal_error!("Cannot compile wasm32 without a host on the dev compiler backend.")
}
(BuiltHostOpt::Legacy(host_path), Architecture::Wasm32) => internal_error!(
"Unsupported host files found for use with wasm32 dev compiler backend:\n {}",
host_path.display()
),
(
BuiltHostOpt::Surgical(SurgicalHostArtifacts {
preprocessed_host, ..
}),
Architecture::Wasm32,
) => internal_error!(
"Unsupported host files found for use with wasm32 dev compiler backend:\n {}",
preprocessed_host.display()
),
(_, Architecture::X86_64 | Architecture::Aarch64) => {
#[cfg(not(feature = "target-wasm32"))]
{
gen_from_mono_module_dev_assembly(arena, loaded, target, backend_mode)
}
#[cfg(feature = "target-wasm32")]
{
internal_error!("Compiler was not built with feature 'target-wasm32'.")
}
}
(_, Architecture::Aarch32) => {
internal_error!("Dev compiler backend does not support 32 bit ARM architectures")
}
(_, Architecture::X86_32) => {
internal_error!("Dev compiler backend does not support 32 bit x86 architectures")
}
_ => todo!(),
}
}
@ -474,7 +497,7 @@ pub fn gen_from_mono_module_dev<'a>(
fn gen_from_mono_module_dev_wasm32<'a>(
arena: &'a bumpalo::Bump,
loaded: MonomorphizedModule<'a>,
preprocessed_host_path: &Path,
built_host_path: &Path,
wasm_dev_stack_bytes: Option<u32>,
) -> GenFromMono<'a> {
let all_code_gen_start = Instant::now();
@ -500,17 +523,17 @@ fn gen_from_mono_module_dev_wasm32<'a>(
stack_bytes: wasm_dev_stack_bytes.unwrap_or(roc_gen_wasm::Env::DEFAULT_STACK_BYTES),
};
let host_bytes = std::fs::read(preprocessed_host_path).unwrap_or_else(|_| {
let host_bytes = std::fs::read(built_host_path).unwrap_or_else(|_| {
internal_error!(
"Failed to read host object file {}! Try omitting --prebuilt-platform",
preprocessed_host_path.display()
"Failed to read host object file {}!",
built_host_path.display()
)
});
let host_module = roc_gen_wasm::parse_host(arena, &host_bytes).unwrap_or_else(|e| {
internal_error!(
"I ran into a problem with the host object file, {} at offset 0x{:x}:\n{}",
preprocessed_host_path.display(),
built_host_path.display(),
e.offset,
e.message
)
@ -544,6 +567,7 @@ fn gen_from_mono_module_dev_wasm32<'a>(
)
}
#[allow(dead_code)]
fn gen_from_mono_module_dev_assembly<'a>(
arena: &'a bumpalo::Bump,
loaded: MonomorphizedModule<'a>,
@ -720,7 +744,8 @@ pub fn build_file<'a>(
emit_timings: bool,
link_type: LinkType,
linking_strategy: LinkingStrategy,
prebuilt_requested: bool,
build_host: bool,
suppress_build_host_warning: bool,
wasm_dev_stack_bytes: Option<u32>,
roc_cache_dir: RocCacheDir<'_>,
load_config: LoadConfig,
@ -728,7 +753,6 @@ pub fn build_file<'a>(
) -> Result<BuiltFile<'a>, BuildFileError<'a>> {
let compilation_start = Instant::now();
// Step 1: compile the app and generate the .o file
let loaded = roc_load::load_and_monomorphize(
arena,
app_module_path.clone(),
@ -746,7 +770,8 @@ pub fn build_file<'a>(
emit_timings,
link_type,
linking_strategy,
prebuilt_requested,
build_host,
suppress_build_host_warning,
wasm_dev_stack_bytes,
loaded,
compilation_start,
@ -754,6 +779,64 @@ pub fn build_file<'a>(
)
}
#[derive(Debug, PartialEq, Eq)]
/// Opt because of possible None value
// Advice: do not try to wrap this in an Option, that would require cloning in build_loaded_file.
pub enum BuiltHostOpt {
Additive(PathBuf),
Legacy(PathBuf),
// SurgicalHostArtifacts contains metadata, preprocessed_host
Surgical(SurgicalHostArtifacts),
None,
}
fn build_and_preprocess_host(
code_gen_options: CodeGenOptions,
dll_stub_symbols: Vec<String>,
emit_timings: bool,
linking_strategy: LinkingStrategy,
platform_main_roc: &Path,
preprocessed_host_path: &Path,
target: Target,
) -> BuiltHostOpt {
let rebuild_thread = match linking_strategy {
LinkingStrategy::Additive => spawn_wasm32_host_build_thread(
code_gen_options.opt_level,
target,
platform_main_roc.to_owned(),
preprocessed_host_path.to_owned(),
),
LinkingStrategy::Surgical => {
let preprocessed_path =
platform_main_roc.with_file_name(target.prebuilt_surgical_host());
let metadata_path = platform_main_roc.with_file_name(target.metadata_file_name());
spawn_surgical_host_build_thread(
code_gen_options.opt_level,
target,
platform_main_roc.to_owned(),
dll_stub_symbols,
preprocessed_path,
preprocessed_host_path.to_owned(),
metadata_path,
)
}
LinkingStrategy::Legacy => spawn_legacy_host_build_thread(
code_gen_options.opt_level,
target,
platform_main_roc.to_owned(),
),
};
let (rebuild_duration, path) = rebuild_thread.join().expect("Failed to build host.");
if emit_timings {
println!(
"Finished rebuilding the platform host in {} ms\n",
rebuild_duration
);
}
path
}
#[allow(clippy::too_many_arguments)]
fn build_loaded_file<'a>(
arena: &'a Bump,
@ -762,121 +845,59 @@ fn build_loaded_file<'a>(
code_gen_options: CodeGenOptions,
emit_timings: bool,
link_type: LinkType,
mut linking_strategy: LinkingStrategy,
prebuilt_requested: bool,
linking_strategy: LinkingStrategy,
build_host_requested: bool,
suppress_build_host_warning: bool,
wasm_dev_stack_bytes: Option<u32>,
loaded: roc_load::MonomorphizedModule<'a>,
compilation_start: Instant,
out_path: Option<&Path>,
) -> Result<BuiltFile<'a>, BuildFileError<'a>> {
let platform_main_roc = match &loaded.entry_point {
// get the platform path from the app header
let platform_main_roc_path = match &loaded.entry_point {
EntryPoint::Executable { platform_path, .. } => platform_path.to_path_buf(),
_ => unreachable!(),
};
// For example, if we're loading the platform from a URL, it's automatically prebuilt
// even if the --prebuilt-platform CLI flag wasn't set.
let is_platform_prebuilt = prebuilt_requested || loaded.uses_prebuilt_platform;
let output_exe_path = get_exe_path(
out_path,
app_module_path.as_path(),
target,
linking_strategy,
link_type,
);
if is_platform_prebuilt && linking_strategy == LinkingStrategy::Surgical {
// Fallback to legacy linking if the preprocessed host file does not exist, but a legacy host does exist.
let preprocessed_host_path =
platform_main_roc.with_file_name(roc_linker::preprocessed_host_filename(target));
let legacy_host_path = legacy_host_file(target, &platform_main_roc);
if !preprocessed_host_path.exists() && legacy_host_path.exists() {
linking_strategy = LinkingStrategy::Legacy;
}
}
let dll_stub_symbols =
roc_linker::ExposedSymbols::from_exposed_to_host(&loaded.interns, &loaded.exposed_to_host);
// the preprocessed host is stored beside the platform's main.roc
let preprocessed_host_path = if linking_strategy == LinkingStrategy::Legacy {
if target == Target::Wasm32 {
// when compiling a wasm application, we implicitly assume here that the host is in zig
// and has a file called "host.zig"
platform_main_roc.with_file_name("host.zig")
let built_host_opt =
// Not sure if this is correct for all calls with LinkType::Dylib...
if link_type == LinkType::Dylib || target == Target::Wasm32 {
BuiltHostOpt::None
} else {
legacy_host_file(target, &platform_main_roc)
}
} else {
platform_main_roc.with_file_name(roc_linker::preprocessed_host_filename(target))
};
let prebuilt_host = determine_built_host_path(&platform_main_roc_path, target, build_host_requested, link_type, linking_strategy, suppress_build_host_warning);
let output_exe_path = match out_path {
Some(path) => {
// true iff the path ends with a directory separator,
// e.g. '/' on UNIX, '/' or '\\' on Windows
let ends_with_sep = {
#[cfg(unix)]
{
use std::os::unix::ffi::OsStrExt;
path.as_os_str().as_bytes().ends_with(&[b'/'])
match prebuilt_host {
BuiltHostOpt::None => {
build_and_preprocess_host(
code_gen_options,
dll_stub_symbols,
emit_timings,
linking_strategy,
&platform_main_roc_path,
&output_exe_path,
target,
)
}
#[cfg(windows)]
{
use std::os::windows::ffi::OsStrExt;
let last = path.as_os_str().encode_wide().last();
last == Some(0x002f)// UTF-16 slash
|| last == Some(0x005c) // UTF-16 backslash
BuiltHostOpt::Surgical(ref surgical_artifacts) => {
// Copy preprocessed host to executable location.
// The surgical linker will modify that copy in-place.
std::fs::copy(&surgical_artifacts.preprocessed_host, output_exe_path.as_path()).unwrap();
prebuilt_host
}
};
// If you specified a path that ends in in a directory separator, then
// use that directory, but use the app module's filename for the filename.
if ends_with_sep {
let filename = app_module_path.file_name().unwrap_or_default();
with_output_extension(&path.join(filename), target, linking_strategy, link_type)
} else {
path.to_path_buf()
other => other
}
}
None => with_output_extension(&app_module_path, target, linking_strategy, link_type),
};
// We don't need to spawn a rebuild thread when using a prebuilt host.
let rebuild_thread = if matches!(link_type, LinkType::Dylib | LinkType::None) {
None
} else if is_platform_prebuilt {
if !preprocessed_host_path.exists() {
invalid_prebuilt_platform(prebuilt_requested, preprocessed_host_path);
std::process::exit(1);
}
if linking_strategy == LinkingStrategy::Surgical {
// Copy preprocessed host to executable location.
// The surgical linker will modify that copy in-place.
std::fs::copy(&preprocessed_host_path, output_exe_path.as_path()).unwrap();
}
None
} else {
// TODO this should probably be moved before load_and_monomorphize.
// To do this we will need to preprocess files just for their exported symbols.
// Also, we should no longer need to do this once we have platforms on
// a package repository, as we can then get prebuilt platforms from there.
let dll_stub_symbols = roc_linker::ExposedSymbols::from_exposed_to_host(
&loaded.interns,
&loaded.exposed_to_host,
);
let join_handle = spawn_rebuild_thread(
code_gen_options.opt_level,
linking_strategy,
platform_main_roc.clone(),
preprocessed_host_path.clone(),
output_exe_path.clone(),
target,
dll_stub_symbols,
);
Some(join_handle)
};
};
let buf = &mut String::with_capacity(1024);
@ -909,31 +930,13 @@ fn build_loaded_file<'a>(
let problems = report_problems_monomorphized(&mut loaded);
let loaded = loaded;
let opt_rebuild_timing = if let Some(rebuild_thread) = rebuild_thread {
if linking_strategy == LinkingStrategy::Additive {
let rebuild_duration = rebuild_thread
.join()
.expect("Failed to (re)build platform.");
if emit_timings && !is_platform_prebuilt {
println!("Finished rebuilding the platform in {rebuild_duration} ms\n");
}
None
} else {
Some(rebuild_thread)
}
} else {
None
};
let (roc_app_bytes, code_gen_timing, expect_metadata) = gen_from_mono_module(
arena,
loaded,
&app_module_path,
target,
code_gen_options,
&preprocessed_host_path,
&built_host_opt,
wasm_dev_stack_bytes,
);
@ -966,24 +969,18 @@ fn build_loaded_file<'a>(
);
}
if let Some(thread) = opt_rebuild_timing {
let rebuild_duration = thread.join().expect("Failed to (re)build platform.");
if emit_timings && !is_platform_prebuilt {
println!("Finished rebuilding the platform in {rebuild_duration} ms\n");
}
}
// Step 2: link the prebuilt platform and compiled app
// link the prebuilt platform and compiled app
let link_start = Instant::now();
match (linking_strategy, link_type) {
(LinkingStrategy::Surgical, _) => {
let metadata_file = platform_main_roc_path.with_file_name(target.metadata_file_name());
roc_linker::link_preprocessed_host(
target,
&platform_main_roc,
&roc_app_bytes,
&output_exe_path,
metadata_file,
);
}
(LinkingStrategy::Additive, _) | (LinkingStrategy::Legacy, LinkType::None) => {
@ -1008,36 +1005,57 @@ fn build_loaded_file<'a>(
std::fs::write(app_o_file, &*roc_app_bytes).unwrap();
let builtins_host_tempfile = roc_bitcode::host_tempfile()
.expect("failed to write host builtins object to tempfile");
let mut inputs = vec![app_o_file.to_str().unwrap()];
if !matches!(link_type, LinkType::Dylib | LinkType::None) {
// the host has been compiled into a .o or .obj file
inputs.push(preprocessed_host_path.as_path().to_str().unwrap());
let mut host_path = String::new();
match built_host_opt {
BuiltHostOpt::Legacy(p) => {
host_path.push_str(&p.to_string_lossy());
inputs.push(&host_path);
}
BuiltHostOpt::None => {
// In case of link_type == LinkType::Dylib or target == Target::Wasm32
// When compiling a Dylib there is no host, such as when generating glue using `roc glue`.
if target == Target::Wasm32 {
let wasm_host_zig: PathBuf =
platform_main_roc_path.with_file_name("host.zig");
assert!(
wasm_host_zig.exists(),
"No host.zig file found at {} when building wasm32 target.",
wasm_host_zig.display()
);
host_path.push_str(&wasm_host_zig.to_string_lossy());
inputs.push(&host_path);
}
}
other => {
panic!("Unexpected variant of built_host_opt in combination with `LinkingStrategy::Legacy`: {:?}", other);
}
}
let builtins_host_tempfile = roc_bitcode::host_tempfile()
.expect("failed to write host builtins object to tempfile");
if matches!(code_gen_options.backend, CodeGenBackend::Assembly(_)) {
inputs.push(builtins_host_tempfile.path().to_str().unwrap());
}
let (mut child, _) = link(target, output_exe_path.clone(), &inputs, link_type)
.map_err(|_| todo!("gracefully handle `ld` failing to spawn."))?;
.map_err(|_| todo!("linker failed to spawn."))?;
let exit_status = child
.wait()
.map_err(|_| todo!("gracefully handle error after `ld` spawned"))?;
.map_err(|_| todo!("linker error after spawning"))?;
// Extend the lifetime of the tempfile so it doesn't get dropped
// (and thus deleted) before the child process is done using it!
let _ = builtins_host_tempfile;
if !exit_status.success() {
todo!(
"gracefully handle `ld` (or `zig` in the case of wasm with --optimize) returning exit code {:?}",
exit_status.code()
);
todo!("linker failed with exit code {:?}", exit_status.code());
}
}
}
@ -1058,124 +1076,291 @@ fn build_loaded_file<'a>(
})
}
fn invalid_prebuilt_platform(prebuilt_requested: bool, preprocessed_host_path: PathBuf) {
let prefix = if prebuilt_requested {
"Because I was run with --prebuilt-platform, "
} else {
""
};
fn determine_built_host_path(
platform_main_roc_path: &Path,
target: Target,
build_host_requested: bool,
link_type: LinkType,
linking_strategy: LinkingStrategy,
suppress_build_host_warning: bool,
) -> BuiltHostOpt {
if build_host_requested {
if !suppress_build_host_warning {
// TODO
//report_rebuilding_existing_host(&preprocessed_host.to_string_lossy());
unimplemented!()
}
let preprocessed_host_path_str = preprocessed_host_path.to_string_lossy();
let extra_err_msg = if preprocessed_host_path_str.ends_with(".rh") {
"\n\n\tNote: If the platform does have an .rh1 file but no .rh file, it's because it's been built with an older version of roc. Contact the author to release a new build of the platform using a roc release newer than March 21 2023.\n"
match link_type {
LinkType::Executable => BuiltHostOpt::None,
LinkType::Dylib => {
eprintln!("You asked me to build the host, but I don't know how to rebuild a host for a dynamic library.");
std::process::exit(1);
}
LinkType::None => {
eprintln!("You asked me to build the host, but I don't know how to rebuild a host for an unlinked object.");
std::process::exit(1);
}
}
} else {
""
};
match linking_strategy {
LinkingStrategy::Legacy => {
let legacy_host_path_res = target.find_legacy_host(platform_main_roc_path);
match legacy_host_path_res {
Ok(legacy_host_path) => BuiltHostOpt::Legacy(legacy_host_path),
Err(err_msg) => {
eprintln!("Legacy linking failed: {}", err_msg);
#[cfg(target_os = "linux")]
eprintln!(
"\n TIP: Maybe try surgical linking with the flag --linker=surgical"
);
std::process::exit(1);
}
}
}
LinkingStrategy::Surgical => {
let surgical_artifacts = target.find_surgical_host(platform_main_roc_path);
match surgical_artifacts {
Ok(surgical_artifacts) => BuiltHostOpt::Surgical(surgical_artifacts),
Err(paths_str) => {
// TODO improve error message
eprintln!(
"LinkingStrategy was set to Surgical (default), but \
I tried to find the surgical host at any of these paths {} but it does not exist.",
paths_str
);
std::process::exit(1);
}
}
}
LinkingStrategy::Additive => {
unimplemented!()
}
}
}
}
/// Get outut path for the executable.
///
/// If you specified a path that ends in in a directory separator, then
/// use that directory, but use the app module's filename for the filename.
fn get_exe_path(
out_path: Option<&Path>,
app_module_path: &Path,
target: Target,
linking_strategy: LinkingStrategy,
link_type: LinkType,
) -> PathBuf {
match out_path {
Some(path) => {
// true iff the path ends with a directory separator,
// e.g. '/' on UNIX, '/' or '\\' on Windows
let ends_with_sep = {
#[cfg(unix)]
{
use std::os::unix::ffi::OsStrExt;
path.as_os_str().as_bytes().ends_with(&[b'/'])
}
#[cfg(windows)]
{
use std::os::windows::ffi::OsStrExt;
let last = path.as_os_str().encode_wide().last();
last == Some(0x002f)// UTF-16 slash
|| last == Some(0x005c) // UTF-16 backslash
}
};
if ends_with_sep {
let filename = app_module_path.file_name().unwrap_or_default();
with_output_extension(&path.join(filename), target, linking_strategy, link_type)
} else {
path.to_path_buf()
}
}
None => with_output_extension(app_module_path, target, linking_strategy, link_type),
}
}
#[allow(dead_code)]
fn report_rebuilding_existing_host(host_path: &str) {
eprintln!(
indoc::indoc!(
r#"
{}I was expecting this file to exist:
WARNING: I found an existing compiled host at:
{}
However, it was not there!{}
However, the --build-host flag was set! I will rebuild the host and overwrite the existing file.
If you have the platform's source code locally, you may be able to generate it by re-running this command omitting --prebuilt-platform
Remove the --build-host flag to use the existing host and silence this warning.
Rebuilding hosts using the roc compiler is deprecated and will be removed in a future version.
"#
),
prefix,
preprocessed_host_path.to_string_lossy(),
extra_err_msg
host_path,
);
}
#[allow(clippy::too_many_arguments)]
fn spawn_rebuild_thread(
#[allow(dead_code)]
fn report_rebuilding_missing_host(host_path: &str) {
eprintln!(
indoc::indoc!(
r#"
WARNING: I was expecting a prebuilt host to exist at:
{}
However, it was not there! I will rebuild the host and write it to that location.
Rebuilding hosts using the roc compiler is deprecated and will be removed in a future version.
"#
),
host_path,
);
}
#[allow(dead_code)]
fn report_missing_prebuilt_host(msg: &str) {
eprintln!(
indoc::indoc!(
r#"
I was expecting a prebuilt host to exist:
{}
However, it was not there!
If you have the platform's source code locally, you may be able to generate it by using a build script.
"#
),
msg
);
}
#[allow(dead_code)]
fn report_refusing_to_rebuild_host(host_path: &str) {
eprintln!(
indoc::indoc!(
r#"
I found a prebuilt host for this platform, but you requested to rebuild it:
{}
Remove the `--build-host` flag to use the prebuilt host.
The `--build-host` flag is deprecated and will be removed in a future release.
"#
),
host_path,
);
}
fn spawn_wasm32_host_build_thread(
opt_level: OptLevel,
linking_strategy: LinkingStrategy,
platform_main_roc: PathBuf,
preprocessed_host_path: PathBuf,
output_exe_path: PathBuf,
target: Target,
dll_stub_symbols: Vec<String>,
) -> std::thread::JoinHandle<u128> {
platform_main_roc: PathBuf,
output_path: PathBuf,
) -> std::thread::JoinHandle<(u128, BuiltHostOpt)> {
std::thread::spawn(move || {
// Printing to stderr because we want stdout to contain only the output of the roc program.
// We are aware of the trade-offs.
// `cargo run` follows the same approach
eprintln!("🔨 Rebuilding platform...");
eprintln!("🔨 Building host ...");
let rebuild_host_start = Instant::now();
let start = Instant::now();
match linking_strategy {
LinkingStrategy::Additive => {
let host_dest = rebuild_host(opt_level, target, platform_main_roc.as_path(), None);
let host_dest = rebuild_host(opt_level, target, platform_main_roc.as_path(), None);
preprocess_host_wasm32(host_dest.as_path(), &preprocessed_host_path);
}
LinkingStrategy::Surgical => {
build_and_preprocess_host_lowlevel(
opt_level,
target,
platform_main_roc.as_path(),
preprocessed_host_path.as_path(),
&dll_stub_symbols,
);
preprocess_host_wasm32(host_dest.as_path(), &output_path);
// Copy preprocessed host to executable location.
// The surgical linker will modify that copy in-place.
std::fs::copy(&preprocessed_host_path, output_exe_path.as_path()).unwrap();
}
LinkingStrategy::Legacy => {
rebuild_host(opt_level, target, platform_main_roc.as_path(), None);
}
}
rebuild_host_start.elapsed().as_millis()
(
start.elapsed().as_millis(),
BuiltHostOpt::Additive(output_path),
)
})
}
pub fn build_and_preprocess_host(
/// Note this will copy the preprocessed host to the executable location
/// where the surgical linker will modify that copy in-place.
fn spawn_surgical_host_build_thread(
opt_level: OptLevel,
target: Target,
platform_main_roc: &Path,
preprocessed_host_path: &Path,
exposed_symbols: roc_linker::ExposedSymbols,
) {
let stub_dll_symbols = exposed_symbols.stub_dll_symbols();
platform_main_roc: PathBuf,
dll_stub_symbols: Vec<String>,
preprocessed_path: PathBuf,
output_exe_path: PathBuf,
metadata_path: PathBuf,
) -> std::thread::JoinHandle<(u128, BuiltHostOpt)> {
std::thread::spawn(move || {
// Printing to stderr because we want stdout to contain only the output of the roc program.
// We are aware of the trade-offs.
// `cargo run` follows the same approach
eprintln!("🔨 Building host ...");
build_and_preprocess_host_lowlevel(
opt_level,
target,
platform_main_roc,
preprocessed_host_path,
&stub_dll_symbols,
)
let start = Instant::now();
let stub_lib = roc_linker::generate_stub_lib_from_loaded(
target,
platform_main_roc.as_path(),
dll_stub_symbols.as_slice(),
);
debug_assert!(stub_lib.exists());
let host_exe = rebuild_host(
opt_level,
target,
platform_main_roc.as_path(),
Some(&stub_lib),
);
roc_linker::preprocess_host(
target,
host_exe.as_path(),
metadata_path.as_path(),
preprocessed_path.as_path(),
&stub_lib,
false,
false,
);
// Copy preprocessed host to executable location.
// The surgical linker will modify that copy in-place.
std::fs::copy(&preprocessed_path, &output_exe_path).unwrap();
(
start.elapsed().as_millis(),
BuiltHostOpt::Surgical(SurgicalHostArtifacts {
metadata: metadata_path,
preprocessed_host: preprocessed_path,
}),
)
})
}
fn build_and_preprocess_host_lowlevel(
// Note the output host will be
fn spawn_legacy_host_build_thread(
opt_level: OptLevel,
target: Target,
platform_main_roc: &Path,
_preprocessed_host_path: &Path,
stub_dll_symbols: &[String],
) {
let stub_lib =
roc_linker::generate_stub_lib_from_loaded(target, platform_main_roc, stub_dll_symbols);
platform_main_roc: PathBuf,
) -> std::thread::JoinHandle<(u128, BuiltHostOpt)> {
std::thread::spawn(move || {
// Printing to stderr because we want stdout to contain only the output of the roc program.
// We are aware of the trade-offs.
// `cargo run` follows the same approach
eprintln!("🔨 Building host ...");
debug_assert!(stub_lib.exists());
let start = Instant::now();
let host_dest = rebuild_host(opt_level, target, platform_main_roc, Some(&stub_lib));
let host_dest = rebuild_host(opt_level, target, platform_main_roc.as_path(), None);
roc_linker::preprocess_host(
target,
host_dest.as_path(),
platform_main_roc,
&stub_lib,
false,
false,
)
(start.elapsed().as_millis(), BuiltHostOpt::Legacy(host_dest))
})
}
#[allow(clippy::too_many_arguments)]
@ -1261,7 +1446,7 @@ pub fn build_str_test<'a>(
arena: &'a Bump,
app_module_path: &Path,
app_module_source: &'a str,
assume_prebuild: bool,
build_host_requested: bool,
) -> Result<BuiltFile<'a>, BuildFileError<'a>> {
let target = target_lexicon::Triple::host().into();
@ -1298,6 +1483,9 @@ pub fn build_str_test<'a>(
)
.map_err(|e| BuildFileError::from_mono_error(e, compilation_start))?;
// we are in a test, so we don't need to provide a warning about rebuilding the host
let suppress_build_host_warning = true;
build_loaded_file(
arena,
target,
@ -1306,7 +1494,8 @@ pub fn build_str_test<'a>(
emit_timings,
link_type,
linking_strategy,
assume_prebuild,
build_host_requested,
suppress_build_host_warning,
wasm_dev_stack_bytes,
loaded,
compilation_start,

View file

@ -10,7 +10,7 @@ Next, look towards the bottom of the `compiler/module/src/symbol.rs` file. Insid
For each of the builtin modules, there is a file in `compiler/test_gen/src/` like `gen_num.rs`, `gen_str.rs` etc. Add new tests for the module you are changing to the appropriate file here. You can look at the existing test cases for examples and inspiration.
You can run your new tests locally using `cargo test-gen-llvm`. You can add a filter like `cargo test-gen-llvm gen_str` (to only run tests defined in `gen_str.rs`) or `cargo test-gen-llvm gen_str::str_split` (to only run tests defined in `gen_str` whose names start with `str_split`). More details can be found in the README in the `compiler/test_gen` directory.
You can run your new tests locally using `cargo test-gen-llvm`. You can add a filter like `cargo test-gen-llvm gen_str` (to only run tests defined in `gen_str.rs`) or `cargo test-gen-llvm gen_str::str_split_on` (to only run tests defined in `gen_str` whose names start with `str_split`). More details can be found in the README in the `compiler/test_gen` directory.
## A builtin implemented directly as LLVM
@ -22,8 +22,8 @@ Some of these have `#` inside their name (`first#list`, `#lt` ..). This is a tri
But we can use these values and some of these are necessary for implementing builtins. For example, `List.get` returns tags, and it is not easy for us to create tags when composing LLVM. What is easier however, is:
- ..writing `List.#getUnsafe` that has the dangerous signature of `List elem, U64 -> elem` in LLVM
- ..writing `List elem, U64 -> Result elem [OutOfBounds]*` in a type safe way that uses `getUnsafe` internally, only after it checks if the `elem` at `U64` index exists.
- ..writing `List.#getUnsafe` that has the dangerous signature of `List elem, U64 -> elem` in LLVM
- ..writing `List elem, U64 -> Result elem [OutOfBounds]*` in a type safe way that uses `getUnsafe` internally, only after it checks if the `elem` at `U64` index exists.
### can/src/builtins.rs
@ -123,5 +123,5 @@ But replace `Num.atan`, the return value, and the return type with your new buil
When implementing a new builtin, it is often easy to copy and paste the implementation for an existing builtin. This can take you quite far since many builtins are very similar, but it also risks forgetting to change one small part of what you copy and pasted and losing a lot of time later on when you cant figure out why things don't work. So, speaking from experience, even if you are copying an existing builtin, try and implement it manually without copying and pasting. Two recent instances of this (as of September 7th, 2020):
- `List.keepIf` did not work for a long time because in builtins its `LowLevel` was `ListMap`. This was because I copy and pasted the `List.map` implementation in `builtins.rs
- `List.walkBackwards` had mysterious memory bugs for a little while because in `unique.rs` its return type was `list_type(flex(b))` instead of `flex(b)` since it was copy and pasted from `List.keepIf`.
- `List.keepIf` did not work for a long time because in builtins its `LowLevel` was `ListMap`. This was because I copy and pasted the `List.map` implementation in `builtins.rs
- `List.walkBackwards` had mysterious memory bugs for a little while because in `unique.rs` its return type was `list_type(flex(b))` instead of `flex(b)` since it was copy and pasted from `List.keepIf`.

View file

@ -185,7 +185,7 @@ comptime {
const str = @import("str.zig");
comptime {
exportStrFn(str.init, "init");
exportStrFn(str.strSplit, "str_split");
exportStrFn(str.strSplitOn, "str_split_on");
exportStrFn(str.countSegments, "count_segments");
exportStrFn(str.countUtf8Bytes, "count_utf8_bytes");
exportStrFn(str.isEmpty, "is_empty");

View file

@ -598,14 +598,14 @@ fn strFromFloatHelp(comptime T: type, float: T) RocStr {
return RocStr.init(&buf, result.len);
}
// Str.split
pub fn strSplit(string: RocStr, delimiter: RocStr) callconv(.C) RocList {
// Str.splitOn
pub fn strSplitOn(string: RocStr, delimiter: RocStr) callconv(.C) RocList {
const segment_count = countSegments(string, delimiter);
const list = RocList.allocate(@alignOf(RocStr), segment_count, @sizeOf(RocStr), true);
if (list.bytes) |bytes| {
const strings = @as([*]RocStr, @ptrCast(@alignCast(bytes)));
strSplitHelp(strings, string, delimiter);
strSplitOnHelp(strings, string, delimiter);
}
return list;
@ -625,7 +625,7 @@ fn initFromBigStr(slice_bytes: [*]u8, len: usize, alloc_ptr: usize) RocStr {
};
}
fn strSplitHelp(array: [*]RocStr, string: RocStr, delimiter: RocStr) void {
fn strSplitOnHelp(array: [*]RocStr, string: RocStr, delimiter: RocStr) void {
if (delimiter.len() == 0) {
string.incref(1);
array[0] = string;
@ -650,7 +650,7 @@ fn strSplitHelp(array: [*]RocStr, string: RocStr, delimiter: RocStr) void {
}
test "strSplitHelp: empty delimiter" {
// Str.split "abc" "" == ["abc"]
// Str.splitOn "abc" "" == ["abc"]
const str_arr = "abc";
const str = RocStr.init(str_arr, str_arr.len);
@ -660,7 +660,7 @@ test "strSplitHelp: empty delimiter" {
var array: [1]RocStr = undefined;
const array_ptr: [*]RocStr = &array;
strSplitHelp(array_ptr, str, delimiter);
strSplitOnHelp(array_ptr, str, delimiter);
var expected = [1]RocStr{
str,
@ -684,7 +684,7 @@ test "strSplitHelp: empty delimiter" {
}
test "strSplitHelp: no delimiter" {
// Str.split "abc" "!" == ["abc"]
// Str.splitOn "abc" "!" == ["abc"]
const str_arr = "abc";
const str = RocStr.init(str_arr, str_arr.len);
@ -694,7 +694,7 @@ test "strSplitHelp: no delimiter" {
var array: [1]RocStr = undefined;
const array_ptr: [*]RocStr = &array;
strSplitHelp(array_ptr, str, delimiter);
strSplitOnHelp(array_ptr, str, delimiter);
var expected = [1]RocStr{
str,
@ -731,7 +731,7 @@ test "strSplitHelp: empty start" {
};
const array_ptr: [*]RocStr = &array;
strSplitHelp(array_ptr, str, delimiter);
strSplitOnHelp(array_ptr, str, delimiter);
const one = RocStr.init("a", 1);
@ -772,7 +772,7 @@ test "strSplitHelp: empty end" {
};
const array_ptr: [*]RocStr = &array;
strSplitHelp(array_ptr, str, delimiter);
strSplitOnHelp(array_ptr, str, delimiter);
const one = RocStr.init("1", 1);
const two = RocStr.init("2", 1);
@ -811,7 +811,7 @@ test "strSplitHelp: string equals delimiter" {
};
const array_ptr: [*]RocStr = &array;
strSplitHelp(array_ptr, str_delimiter, str_delimiter);
strSplitOnHelp(array_ptr, str_delimiter, str_delimiter);
var expected = [2]RocStr{ RocStr.empty(), RocStr.empty() };
@ -846,7 +846,7 @@ test "strSplitHelp: delimiter on sides" {
undefined,
};
const array_ptr: [*]RocStr = &array;
strSplitHelp(array_ptr, str, delimiter);
strSplitOnHelp(array_ptr, str, delimiter);
const ghi_arr = "ghi";
const ghi = RocStr.init(ghi_arr, ghi_arr.len);
@ -875,7 +875,7 @@ test "strSplitHelp: delimiter on sides" {
}
test "strSplitHelp: three pieces" {
// Str.split "a!b!c" "!" == ["a", "b", "c"]
// Str.splitOn "a!b!c" "!" == ["a", "b", "c"]
const str_arr = "a!b!c";
const str = RocStr.init(str_arr, str_arr.len);
@ -886,7 +886,7 @@ test "strSplitHelp: three pieces" {
var array: [array_len]RocStr = undefined;
const array_ptr: [*]RocStr = &array;
strSplitHelp(array_ptr, str, delimiter);
strSplitOnHelp(array_ptr, str, delimiter);
const a = RocStr.init("a", 1);
const b = RocStr.init("b", 1);
@ -916,7 +916,7 @@ test "strSplitHelp: three pieces" {
}
test "strSplitHelp: overlapping delimiter 1" {
// Str.split "aaa" "aa" == ["", "a"]
// Str.splitOn "aaa" "aa" == ["", "a"]
const str_arr = "aaa";
const str = RocStr.init(str_arr, str_arr.len);
@ -926,7 +926,7 @@ test "strSplitHelp: overlapping delimiter 1" {
var array: [2]RocStr = undefined;
const array_ptr: [*]RocStr = &array;
strSplitHelp(array_ptr, str, delimiter);
strSplitOnHelp(array_ptr, str, delimiter);
var expected = [2]RocStr{
RocStr.empty(),
@ -941,7 +941,7 @@ test "strSplitHelp: overlapping delimiter 1" {
}
test "strSplitHelp: overlapping delimiter 2" {
// Str.split "aaa" "aa" == ["", "a"]
// Str.splitOn "aaa" "aa" == ["", "a"]
const str_arr = "aaaa";
const str = RocStr.init(str_arr, str_arr.len);
@ -951,7 +951,7 @@ test "strSplitHelp: overlapping delimiter 2" {
var array: [3]RocStr = undefined;
const array_ptr: [*]RocStr = &array;
strSplitHelp(array_ptr, str, delimiter);
strSplitOnHelp(array_ptr, str, delimiter);
var expected = [3]RocStr{
RocStr.empty(),
@ -967,7 +967,7 @@ test "strSplitHelp: overlapping delimiter 2" {
try expect(array[2].eq(expected[2]));
}
// This is used for `Str.split : Str, Str -> Array Str
// This is used for `Str.splitOn : Str, Str -> List Str
// It is used to count how many segments the input `_str`
// needs to be broken into, so that we can allocate a array
// of that size. It always returns at least 1.
@ -985,7 +985,7 @@ pub fn countSegments(string: RocStr, delimiter: RocStr) callconv(.C) usize {
}
test "countSegments: long delimiter" {
// Str.split "str" "delimiter" == ["str"]
// Str.splitOn "str" "delimiter" == ["str"]
// 1 segment
const str_arr = "str";
const str = RocStr.init(str_arr, str_arr.len);
@ -1003,7 +1003,7 @@ test "countSegments: long delimiter" {
}
test "countSegments: delimiter at start" {
// Str.split "hello there" "hello" == ["", " there"]
// Str.splitOn "hello there" "hello" == ["", " there"]
// 2 segments
const str_arr = "hello there";
const str = RocStr.init(str_arr, str_arr.len);
@ -1022,7 +1022,7 @@ test "countSegments: delimiter at start" {
}
test "countSegments: delimiter interspered" {
// Str.split "a!b!c" "!" == ["a", "b", "c"]
// Str.splitOn "a!b!c" "!" == ["a", "b", "c"]
// 3 segments
const str_arr = "a!b!c";
const str = RocStr.init(str_arr, str_arr.len);
@ -1041,7 +1041,7 @@ test "countSegments: delimiter interspered" {
}
test "countSegments: string equals delimiter" {
// Str.split "/" "/" == ["", ""]
// Str.splitOn "/" "/" == ["", ""]
// 2 segments
const str_delimiter_arr = "/";
const str_delimiter = RocStr.init(str_delimiter_arr, str_delimiter_arr.len);
@ -1056,14 +1056,14 @@ test "countSegments: string equals delimiter" {
}
test "countSegments: overlapping delimiter 1" {
// Str.split "aaa" "aa" == ["", "a"]
// Str.splitOn "aaa" "aa" == ["", "a"]
const segments_count = countSegments(RocStr.init("aaa", 3), RocStr.init("aa", 2));
try expectEqual(segments_count, 2);
}
test "countSegments: overlapping delimiter 2" {
// Str.split "aaa" "aa" == ["", "a"]
// Str.splitOn "aaa" "aa" == ["", "a"]
const segments_count = countSegments(RocStr.init("aaaa", 4), RocStr.init("aa", 2));
try expectEqual(segments_count, 3);

View file

@ -55,7 +55,9 @@ module [
findLastIndex,
sublist,
intersperse,
split,
splitAt,
splitOn,
splitOnList,
splitFirst,
splitLast,
startsWith,
@ -70,6 +72,8 @@ module [
countIf,
chunksOf,
concatUtf8,
forEach!,
forEachTry!,
]
import Bool exposing [Bool, Eq]
@ -1026,7 +1030,7 @@ first = \list ->
## To remove elements from both the beginning and end of the list,
## use `List.sublist`.
##
## To split the list into two lists, use `List.split`.
## To split the list into two lists, use `List.splitAt`.
##
takeFirst : List elem, U64 -> List elem
takeFirst = \list, outputLength ->
@ -1046,7 +1050,7 @@ takeFirst = \list, outputLength ->
## To remove elements from both the beginning and end of the list,
## use `List.sublist`.
##
## To split the list into two lists, use `List.split`.
## To split the list into two lists, use `List.splitAt`.
##
takeLast : List elem, U64 -> List elem
takeLast = \list, outputLength ->
@ -1247,8 +1251,8 @@ endsWith = \list, suffix ->
## than the given index, # and the `others` list will be all the others. (This
## means if you give an index of 0, the `before` list will be empty and the
## `others` list will have the same elements as the original list.)
split : List elem, U64 -> { before : List elem, others : List elem }
split = \elements, userSplitIndex ->
splitAt : List elem, U64 -> { before : List elem, others : List elem }
splitAt = \elements, userSplitIndex ->
length = List.len elements
splitIndex = if length > userSplitIndex then userSplitIndex else length
before = List.sublist elements { start: 0, len: splitIndex }
@ -1256,6 +1260,44 @@ split = \elements, userSplitIndex ->
{ before, others }
## Splits the input list on the delimiter element.
##
## ```roc
## List.splitOn [1, 2, 3] 2 == [[1], [3]]
## ```
splitOn : List a, a -> List (List a) where a implements Eq
splitOn = \elements, delimiter ->
help = \remaining, chunks, currentChunk ->
when remaining is
[] -> List.append chunks currentChunk
[x, .. as rest] if x == delimiter ->
help rest (List.append chunks currentChunk) []
[x, .. as rest] ->
help rest chunks (List.append currentChunk x)
help elements [] []
## Splits the input list on the delimiter list.
##
## ```roc
## List.splitOnList [1, 2, 3] [1, 2] == [[], [3]]
## ```
splitOnList : List a, List a -> List (List a) where a implements Eq
splitOnList = \elements, delimiter ->
help = \remaining, chunks, currentChunk ->
when remaining is
[] -> List.append chunks currentChunk
[x, .. as rest] ->
if List.startsWith remaining delimiter then
help (List.dropFirst remaining (List.len delimiter)) (List.append chunks currentChunk) []
else
help rest chunks (List.append currentChunk x)
if delimiter == [] then
[elements]
else
help elements [] []
## Returns the elements before the first occurrence of a delimiter, as well as the
## remaining elements after that occurrence. If the delimiter is not found, returns `Err`.
## ```roc
@ -1305,7 +1347,7 @@ chunksOfHelp = \listRest, chunkSize, chunks ->
if List.isEmpty listRest then
chunks
else
{ before, others } = List.split listRest chunkSize
{ before, others } = List.splitAt listRest chunkSize
chunksOfHelp others chunkSize (List.append chunks before)
## Like [List.map], except the transformation function returns a [Result].
@ -1383,3 +1425,44 @@ concatUtf8 : List U8, Str -> List U8
expect (List.concatUtf8 [1, 2, 3, 4] "🐦") == [1, 2, 3, 4, 240, 159, 144, 166]
## Run an effectful function for each element on the list.
##
## ```roc
## List.forEach! ["Alice", "Bob", "Charlie"] \name ->
## createAccount! name
## log! "Account created"
## ```
##
## If the function might fail or you need to return early, use [forEachTry!].
forEach! : List a, (a => {}) => {}
forEach! = \list, func! ->
when list is
[] ->
{}
[elem, .. as rest] ->
func! elem
forEach! rest func!
## Run an effectful function that might fail for each element on the list.
##
## If the function returns `Err`, the iteration stops and the error is returned.
##
## ```roc
## List.forEachTry! filesToDelete \path ->
## try File.delete! path
## Stdout.line! "$(path) deleted"
## ```
forEachTry! : List a, (a => Result {} err) => Result {} err
forEachTry! = \list, func! ->
when list is
[] ->
Ok {}
[elem, .. as rest] ->
when func! elem is
Ok {} ->
forEachTry! rest func!
Err err ->
Err err

View file

@ -8,6 +8,7 @@ module [
map2,
try,
onErr,
onErr!,
withDefault,
]
@ -119,3 +120,16 @@ onErr = \result, transform ->
when result is
Ok v -> Ok v
Err e -> transform e
## Like [onErr], but it allows the transformation function to produce effects.
##
## ```roc
## Result.onErr (Err "missing user") \msg ->
## try Stdout.line! "ERROR: $(msg)"
## Err msg
## ```
onErr! : Result a err, (err => Result a otherErr) => Result a otherErr
onErr! = \result, transform! ->
when result is
Ok v -> Ok v
Err e -> transform! e

View file

@ -253,7 +253,7 @@
##
## The way Roc organizes the `Str` module and supporting packages is designed to help answer this question. Every situation is different, but the following rules of thumb are typical:
##
## * Most often, using `Str` values along with helper functions like [`split`](https://www.roc-lang.org/builtins/Str#split), [`joinWith`](https://www.roc-lang.org/builtins/Str#joinWith), and so on, is the best option.
## * Most often, using `Str` values along with helper functions like [`splitOn`](https://www.roc-lang.org/builtins/Str#splitOn), [`joinWith`](https://www.roc-lang.org/builtins/Str#joinWith), and so on, is the best option.
## * If you are specifically implementing a parser, working in UTF-8 bytes is usually the best option. So functions like [`walkUtf8`](https://www.roc-lang.org/builtins/Str#walkUtf8), [toUtf8](https://www.roc-lang.org/builtins/Str#toUtf8), and so on. (Note that single-quote literals produce number literals, so ASCII-range literals like `'a'` gives an integer literal that works with a UTF-8 `U8`.)
## * If you are implementing a Unicode library like [roc-lang/unicode](https://github.com/roc-lang/unicode), working in terms of code points will be unavoidable. Aside from basic readability considerations like `\u(...)` in string literals, if you have the option to avoid working in terms of code points, it is almost always correct to avoid them.
## * If it seems like a good idea to split a string into "characters" (graphemes), you should definitely stop and reconsider whether this is really the best design. Almost always, doing this is some combination of more error-prone or slower (usually both) than doing something else that does not require taking graphemes into consideration.
@ -294,7 +294,7 @@
## Try putting this into `roc repl`:
##
## ```
## » "foo/bar/baz" |> Str.split "/"
## » "foo/bar/baz" |> Str.splitOn "/"
##
## ["foo", "bar", "baz"] : List Str
## ```
@ -304,7 +304,7 @@
## Now let's suppose they were long enough that this optimization no longer applied:
##
## ```
## » "a much, much, much, much/longer/string compared to the last one!" |> Str.split "/"
## » "a much, much, much, much/longer/string compared to the last one!" |> Str.splitOn "/"
##
## ["a much, much, much, much", "longer", "string compared to the last one!"] : List Str
## ```
@ -332,7 +332,7 @@ module [
concat,
isEmpty,
joinWith,
split,
splitOn,
repeat,
countUtf8Bytes,
toUtf8,
@ -499,10 +499,10 @@ joinWith : List Str, Str -> Str
## Passing `""` for the separator is not useful;
## it returns the original string wrapped in a [List].
## ```roc
## expect Str.split "1,2,3" "," == ["1","2","3"]
## expect Str.split "1,2,3" "" == ["1,2,3"]
## expect Str.splitOn "1,2,3" "," == ["1","2","3"]
## expect Str.splitOn "1,2,3" "" == ["1,2,3"]
## ```
split : Str, Str -> List Str
splitOn : Str, Str -> List Str
## Repeats a string the given number of times.
## ```roc
@ -518,7 +518,7 @@ repeat : Str, U64 -> Str
## Returns a [List] of the string's [U8] UTF-8 [code units](https://unicode.org/glossary/#code_unit).
## (To split the string into a [List] of smaller [Str] values instead of [U8] values,
## see [Str.split].)
## see [Str.splitOn].)
## ```roc
## expect Str.toUtf8 "Roc" == [82, 111, 99]
## expect Str.toUtf8 "鹏" == [233, 185, 143]

View file

@ -343,7 +343,7 @@ pub const STR_INIT: &str = "roc_builtins.str.init";
pub const STR_COUNT_SEGMENTS: &str = "roc_builtins.str.count_segments";
pub const STR_CONCAT: &str = "roc_builtins.str.concat";
pub const STR_JOIN_WITH: &str = "roc_builtins.str.joinWith";
pub const STR_SPLIT: &str = "roc_builtins.str.str_split";
pub const STR_SPLIT_ON: &str = "roc_builtins.str.str_split_on";
pub const STR_COUNT_UTF8_BYTES: &str = "roc_builtins.str.count_utf8_bytes";
pub const STR_IS_EMPTY: &str = "roc_builtins.str.is_empty";
pub const STR_CAPACITY: &str = "roc_builtins.str.capacity";

View file

@ -2,12 +2,12 @@ use crate::env::Env;
use crate::procedure::{QualifiedReference, References};
use crate::scope::{PendingAbilitiesInScope, Scope, SymbolLookup};
use roc_collections::{ImMap, MutSet, SendMap, VecMap, VecSet};
use roc_module::ident::{Ident, Lowercase, TagName};
use roc_module::ident::{Ident, IdentSuffix, Lowercase, TagName};
use roc_module::symbol::Symbol;
use roc_parse::ast::{
AssignedField, ExtractSpaces, FunctionArrow, Pattern, Tag, TypeAnnotation, TypeHeader,
};
use roc_problem::can::ShadowKind;
use roc_problem::can::{Problem, ShadowKind};
use roc_region::all::{Loc, Region};
use roc_types::subs::{VarStore, Variable};
use roc_types::types::{
@ -482,7 +482,6 @@ pub fn find_type_def_symbols(
AssignedField::LabelOnly(_) => {}
AssignedField::SpaceBefore(inner, _)
| AssignedField::SpaceAfter(inner, _) => inner_stack.push(inner),
AssignedField::Malformed(_) => {}
}
}
@ -507,7 +506,6 @@ pub fn find_type_def_symbols(
Tag::SpaceBefore(inner, _) | Tag::SpaceAfter(inner, _) => {
inner_stack.push(inner)
}
Tag::Malformed(_) => {}
}
}
@ -1355,7 +1353,7 @@ fn can_assigned_fields<'a>(
// field names we've seen so far in this record
let mut seen = std::collections::HashMap::with_capacity(fields.len());
'outer: for loc_field in fields.iter() {
for loc_field in fields.iter() {
let mut field = &loc_field.value;
// use this inner loop to unwrap the SpaceAfter/SpaceBefore
@ -1378,6 +1376,8 @@ fn can_assigned_fields<'a>(
);
let label = Lowercase::from(field_name.value);
check_record_field_suffix(env, label.suffix(), &field_type, &loc_field.region);
field_types.insert(label.clone(), RigidRequired(field_type));
break 'inner label;
@ -1396,6 +1396,8 @@ fn can_assigned_fields<'a>(
);
let label = Lowercase::from(field_name.value);
check_record_field_suffix(env, label.suffix(), &field_type, &loc_field.region);
field_types.insert(label.clone(), RigidOptional(field_type));
break 'inner label;
@ -1426,12 +1428,6 @@ fn can_assigned_fields<'a>(
field = nested;
continue 'inner;
}
Malformed(string) => {
malformed(env, region, string);
// completely skip this element, advance to the next tag
continue 'outer;
}
}
};
@ -1450,6 +1446,23 @@ fn can_assigned_fields<'a>(
field_types
}
fn check_record_field_suffix(
env: &mut Env,
suffix: IdentSuffix,
field_type: &Type,
region: &Region,
) {
match (suffix, field_type) {
(IdentSuffix::None, Type::Function(_, _, _, fx)) if **fx == Type::Effectful => env
.problems
.push(Problem::UnsuffixedEffectfulRecordField(*region)),
(IdentSuffix::Bang, Type::Function(_, _, _, fx)) if **fx == Type::Pure => {
env.problems.push(Problem::SuffixedPureRecordField(*region))
}
_ => {}
}
}
// TODO trim down these arguments!
#[allow(clippy::too_many_arguments)]
fn can_assigned_tuple_elems(
@ -1501,7 +1514,7 @@ fn can_tags<'a>(
// tag names we've seen so far in this tag union
let mut seen = std::collections::HashMap::with_capacity(tags.len());
'outer: for loc_tag in tags.iter() {
for loc_tag in tags.iter() {
let mut tag = &loc_tag.value;
// use this inner loop to unwrap the SpaceAfter/SpaceBefore
@ -1540,12 +1553,6 @@ fn can_tags<'a>(
tag = nested;
continue 'inner;
}
Tag::Malformed(string) => {
malformed(env, region, string);
// completely skip this element, advance to the next tag
continue 'outer;
}
}
};

View file

@ -116,7 +116,7 @@ map_symbol_to_lowlevel_and_arity! {
StrIsEmpty; STR_IS_EMPTY; 1,
StrStartsWith; STR_STARTS_WITH; 2,
StrEndsWith; STR_ENDS_WITH; 2,
StrSplit; STR_SPLIT; 2,
StrSplitOn; STR_SPLIT_ON; 2,
StrCountUtf8Bytes; STR_COUNT_UTF8_BYTES; 1,
StrFromUtf8; STR_FROM_UTF8_LOWLEVEL; 1,
StrToUtf8; STR_TO_UTF8; 1,

View file

@ -618,15 +618,10 @@ impl Constraints {
Constraint::FxSuffix(constraint_index)
}
pub fn fx_record_field_suffix(
&mut self,
suffix: IdentSuffix,
variable: Variable,
region: Region,
) -> Constraint {
pub fn fx_record_field_unsuffixed(&mut self, variable: Variable, region: Region) -> Constraint {
let type_index = Self::push_type_variable(variable);
let constraint = FxSuffixConstraint {
kind: FxSuffixKind::RecordField(suffix),
kind: FxSuffixKind::UnsuffixedRecordField,
type_index,
region,
};
@ -952,14 +947,14 @@ pub struct FxSuffixConstraint {
pub enum FxSuffixKind {
Let(Symbol),
Pattern(Symbol),
RecordField(IdentSuffix),
UnsuffixedRecordField,
}
impl FxSuffixKind {
pub fn suffix(&self) -> IdentSuffix {
match self {
Self::Let(symbol) | Self::Pattern(symbol) => symbol.suffix(),
Self::RecordField(suffix) => *suffix,
Self::UnsuffixedRecordField => IdentSuffix::None,
}
}
}

View file

@ -694,16 +694,6 @@ fn deep_copy_expr_help<C: CopyEnv>(env: &mut C, copied: &mut Vec<Variable>, expr
lookups_in_cond: lookups_in_cond.to_vec(),
},
ExpectFx {
loc_condition,
loc_continuation,
lookups_in_cond,
} => ExpectFx {
loc_condition: Box::new(loc_condition.map(|e| go_help!(e))),
loc_continuation: Box::new(loc_continuation.map(|e| go_help!(e))),
lookups_in_cond: lookups_in_cond.to_vec(),
},
Return {
return_value,
return_var,

View file

@ -453,7 +453,6 @@ fn expr<'a>(c: &Ctx, p: EPrec, f: &'a Arena<'a>, e: &'a Expr) -> DocBuilder<'a,
),
Dbg { .. } => todo!(),
Expect { .. } => todo!(),
ExpectFx { .. } => todo!(),
Return { .. } => todo!(),
TypedHole(_) => todo!(),
RuntimeError(_) => todo!(),

View file

@ -171,7 +171,6 @@ pub(crate) struct CanDefs {
defs: Vec<Option<Def>>,
dbgs: ExpectsOrDbgs,
expects: ExpectsOrDbgs,
expects_fx: ExpectsOrDbgs,
def_ordering: DefOrdering,
aliases: VecMap<Symbol, Alias>,
}
@ -715,10 +714,6 @@ fn canonicalize_claimed_ability_impl<'a>(
});
Err(())
}
AssignedField::Malformed(_) => {
// An error will already have been reported
Err(())
}
AssignedField::SpaceBefore(_, _)
| AssignedField::SpaceAfter(_, _)
| AssignedField::IgnoredValue(_, _, _) => {
@ -1174,7 +1169,6 @@ fn canonicalize_value_defs<'a>(
let mut pending_value_defs = Vec::with_capacity(value_defs.len());
let mut pending_dbgs = Vec::with_capacity(value_defs.len());
let mut pending_expects = Vec::with_capacity(value_defs.len());
let mut pending_expect_fx = Vec::with_capacity(value_defs.len());
let mut imports_introduced = Vec::with_capacity(value_defs.len());
@ -1194,9 +1188,6 @@ fn canonicalize_value_defs<'a>(
PendingValue::Expect(pending_expect) => {
pending_expects.push(pending_expect);
}
PendingValue::ExpectFx(pending_expect) => {
pending_expect_fx.push(pending_expect);
}
PendingValue::ModuleImport(PendingModuleImport {
module_id,
region,
@ -1282,7 +1273,6 @@ fn canonicalize_value_defs<'a>(
let mut dbgs = ExpectsOrDbgs::with_capacity(pending_dbgs.len());
let mut expects = ExpectsOrDbgs::with_capacity(pending_expects.len());
let mut expects_fx = ExpectsOrDbgs::with_capacity(pending_expects.len());
for pending in pending_dbgs {
let (loc_can_condition, can_output) = canonicalize_expr(
@ -1312,25 +1302,10 @@ fn canonicalize_value_defs<'a>(
output.union(can_output);
}
for pending in pending_expect_fx {
let (loc_can_condition, can_output) = canonicalize_expr(
env,
var_store,
scope,
pending.condition.region,
&pending.condition.value,
);
expects_fx.push(loc_can_condition, pending.preceding_comment);
output.union(can_output);
}
let can_defs = CanDefs {
defs,
dbgs,
expects,
expects_fx,
def_ordering,
aliases,
};
@ -1738,7 +1713,6 @@ pub(crate) fn sort_top_level_can_defs(
defs,
dbgs: _,
expects,
expects_fx,
def_ordering,
aliases,
} = defs;
@ -1769,19 +1743,6 @@ pub(crate) fn sort_top_level_can_defs(
declarations.push_expect(preceding_comment, name, Loc::at(region, condition));
}
let it = expects_fx
.conditions
.into_iter()
.zip(expects_fx.regions)
.zip(expects_fx.preceding_comment);
for ((condition, region), preceding_comment) in it {
// an `expect` does not have a user-defined name, but we'll need a name to call the expectation
let name = scope.gen_unique_symbol();
declarations.push_expect_fx(preceding_comment, name, Loc::at(region, condition));
}
for (symbol, alias) in aliases.into_iter() {
output.aliases.insert(symbol, alias);
}
@ -2019,7 +1980,6 @@ pub(crate) fn sort_can_defs(
mut defs,
dbgs,
expects,
expects_fx,
def_ordering,
aliases,
} = defs;
@ -2153,10 +2113,6 @@ pub(crate) fn sort_can_defs(
declarations.push(Declaration::Expects(expects));
}
if !expects_fx.conditions.is_empty() {
declarations.push(Declaration::ExpectsFx(expects_fx));
}
(declarations, output)
}
@ -3082,7 +3038,6 @@ enum PendingValue<'a> {
Def(PendingValueDef<'a>),
Dbg(PendingExpectOrDbg<'a>),
Expect(PendingExpectOrDbg<'a>),
ExpectFx(PendingExpectOrDbg<'a>),
ModuleImport(PendingModuleImport<'a>),
SignatureDefMismatch,
InvalidIngestedFile,
@ -3222,14 +3177,6 @@ fn to_pending_value_def<'a>(
preceding_comment: *preceding_comment,
}),
ExpectFx {
condition,
preceding_comment,
} => PendingValue::ExpectFx(PendingExpectOrDbg {
condition,
preceding_comment: *preceding_comment,
}),
ModuleImport(module_import) => {
let qualified_module_name: QualifiedModuleName = module_import.name.value.into();
let module_name = qualified_module_name.module.clone();

View file

@ -167,16 +167,6 @@ fn desugar_value_def<'a>(
preceding_comment: *preceding_comment,
}
}
ExpectFx {
condition,
preceding_comment,
} => {
let desugared_condition = &*env.arena.alloc(desugar_expr(env, scope, condition));
ExpectFx {
condition: desugared_condition,
preceding_comment: *preceding_comment,
}
}
ModuleImport(roc_parse::ast::ModuleImport {
before_name,
name,
@ -380,8 +370,8 @@ pub fn desugar_value_def_suffixed<'a>(arena: &'a Bump, value_def: ValueDef<'a>)
}
},
// TODO support desugaring of Dbg and ExpectFx
Dbg { .. } | ExpectFx { .. } => value_def,
// TODO support desugaring of Dbg
Dbg { .. } => value_def,
ModuleImport { .. } | IngestedFileImport(_) | StmtAfterExpr => value_def,
Stmt(..) => {
@ -407,7 +397,6 @@ pub fn desugar_expr<'a>(
| AccessorFunction(_)
| Underscore { .. }
| MalformedIdent(_, _)
| MalformedClosure
| MalformedSuffixed(..)
| PrecedenceConflict { .. }
| EmptyRecordBuilder(_)
@ -712,7 +701,6 @@ pub fn desugar_expr<'a>(
AssignedField::SpaceBefore(_, _) | AssignedField::SpaceAfter(_, _) => {
unreachable!("Should have been desugared in `desugar_field`")
}
AssignedField::Malformed(_name) => continue,
};
field_data.push(FieldData {
@ -1316,8 +1304,6 @@ fn desugar_field<'a>(
}
SpaceBefore(field, _spaces) => desugar_field(env, scope, field),
SpaceAfter(field, _spaces) => desugar_field(env, scope, field),
Malformed(string) => Malformed(string),
}
}

View file

@ -271,13 +271,6 @@ pub enum Expr {
lookups_in_cond: Vec<ExpectLookup>,
},
// not parsed, but is generated when lowering toplevel effectful expects
ExpectFx {
loc_condition: Box<Loc<Expr>>,
loc_continuation: Box<Loc<Expr>>,
lookups_in_cond: Vec<ExpectLookup>,
},
Dbg {
source_location: Box<str>,
source: Box<str>,
@ -364,7 +357,6 @@ impl Expr {
Category::OpaqueWrap(opaque_name)
}
Self::Expect { .. } => Category::Expect,
Self::ExpectFx { .. } => Category::Expect,
Self::Crash { .. } => Category::Crash,
Self::Return { .. } => Category::Return,
@ -1391,10 +1383,6 @@ pub fn canonicalize_expr<'a>(
Output::default(),
)
}
ast::Expr::MalformedClosure => {
use roc_problem::can::RuntimeError::*;
(RuntimeError(MalformedClosure(region)), Output::default())
}
ast::Expr::MalformedIdent(name, bad_ident) => {
use roc_problem::can::RuntimeError::*;
@ -1976,10 +1964,6 @@ fn canonicalize_field<'a>(
SpaceBefore(sub_field, _) | SpaceAfter(sub_field, _) => {
canonicalize_field(env, var_store, scope, sub_field)
}
Malformed(_string) => {
internal_error!("TODO canonicalize malformed record field");
}
}
}
@ -2225,28 +2209,6 @@ pub fn inline_calls(var_store: &mut VarStore, expr: Expr) -> Expr {
}
}
ExpectFx {
loc_condition,
loc_continuation,
lookups_in_cond,
} => {
let loc_condition = Loc {
region: loc_condition.region,
value: inline_calls(var_store, loc_condition.value),
};
let loc_continuation = Loc {
region: loc_continuation.region,
value: inline_calls(var_store, loc_continuation.value),
};
ExpectFx {
loc_condition: Box::new(loc_condition),
loc_continuation: Box::new(loc_continuation),
lookups_in_cond,
}
}
Dbg {
source_location,
source,
@ -2568,8 +2530,7 @@ pub fn is_valid_interpolation(expr: &ast::Expr<'_>) -> bool {
| ast::Expr::Underscore(_)
| ast::Expr::MalformedIdent(_, _)
| ast::Expr::Tag(_)
| ast::Expr::OpaqueRef(_)
| ast::Expr::MalformedClosure => true,
| ast::Expr::OpaqueRef(_) => true,
// Newlines are disallowed inside interpolation, and these all require newlines
ast::Expr::DbgStmt(_, _)
| ast::Expr::LowLevelDbg(_, _, _)
@ -2604,7 +2565,7 @@ pub fn is_valid_interpolation(expr: &ast::Expr<'_>) -> bool {
| ast::AssignedField::IgnoredValue(_label, loc_comments, loc_val) => {
loc_comments.is_empty() && is_valid_interpolation(&loc_val.value)
}
ast::AssignedField::Malformed(_) | ast::AssignedField::LabelOnly(_) => true,
ast::AssignedField::LabelOnly(_) => true,
ast::AssignedField::SpaceBefore(_, _) | ast::AssignedField::SpaceAfter(_, _) => false,
}),
ast::Expr::Tuple(fields) => fields
@ -2655,7 +2616,7 @@ pub fn is_valid_interpolation(expr: &ast::Expr<'_>) -> bool {
| ast::AssignedField::IgnoredValue(_label, loc_comments, loc_val) => {
loc_comments.is_empty() && is_valid_interpolation(&loc_val.value)
}
ast::AssignedField::Malformed(_) | ast::AssignedField::LabelOnly(_) => true,
ast::AssignedField::LabelOnly(_) => true,
ast::AssignedField::SpaceBefore(_, _)
| ast::AssignedField::SpaceAfter(_, _) => false,
})
@ -2668,7 +2629,7 @@ pub fn is_valid_interpolation(expr: &ast::Expr<'_>) -> bool {
| ast::AssignedField::IgnoredValue(_label, loc_comments, loc_val) => {
loc_comments.is_empty() && is_valid_interpolation(&loc_val.value)
}
ast::AssignedField::Malformed(_) | ast::AssignedField::LabelOnly(_) => true,
ast::AssignedField::LabelOnly(_) => true,
ast::AssignedField::SpaceBefore(_, _)
| ast::AssignedField::SpaceAfter(_, _) => false,
})
@ -3028,24 +2989,6 @@ impl Declarations {
index
}
pub fn push_expect_fx(
&mut self,
preceding_comment: Region,
name: Symbol,
loc_expr: Loc<Expr>,
) -> usize {
let index = self.declarations.len();
self.declarations.push(DeclarationTag::ExpectationFx);
self.variables.push(Variable::BOOL);
self.symbols.push(Loc::at(preceding_comment, name));
self.annotations.push(None);
self.expressions.push(loc_expr);
index
}
pub fn push_value_def(
&mut self,
symbol: Loc<Symbol>,
@ -3486,9 +3429,6 @@ pub(crate) fn get_lookup_symbols(expr: &Expr) -> Vec<ExpectLookup> {
Expr::Expect {
loc_continuation, ..
}
| Expr::ExpectFx {
loc_continuation, ..
}
| Expr::Dbg {
loc_continuation, ..
} => {
@ -3590,18 +3530,11 @@ fn toplevel_expect_to_inline_expect_help(mut loc_expr: Loc<Expr>, has_effects: b
}
let expect_region = loc_expr.region;
let expect = if has_effects {
Expr::ExpectFx {
loc_condition: Box::new(loc_expr),
loc_continuation: Box::new(Loc::at_zero(Expr::EmptyRecord)),
lookups_in_cond,
}
} else {
Expr::Expect {
loc_condition: Box::new(loc_expr),
loc_continuation: Box::new(Loc::at_zero(Expr::EmptyRecord)),
lookups_in_cond,
}
assert!(!has_effects);
let expect = Expr::Expect {
loc_condition: Box::new(loc_expr),
loc_continuation: Box::new(Loc::at_zero(Expr::EmptyRecord)),
lookups_in_cond,
};
let mut loc_expr = Loc::at(expect_region, expect);
@ -3633,11 +3566,6 @@ impl crate::traverse::Visitor for ExpectCollector {
lookups_in_cond,
loc_condition,
..
}
| Expr::ExpectFx {
lookups_in_cond,
loc_condition,
..
} => {
self.expects
.insert(loc_condition.region, lookups_in_cond.to_vec());

View file

@ -956,11 +956,6 @@ fn fix_values_captured_in_closure_expr(
loc_continuation,
..
}
| ExpectFx {
loc_condition,
loc_continuation,
..
}
| Dbg {
loc_message: loc_condition,
loc_continuation,

View file

@ -680,7 +680,7 @@ pub fn unwrap_suffixed_expression_defs_help<'a>(
};
let maybe_suffixed_value_def = match current_value_def {
Annotation(..) | Dbg{..} | Expect{..} | ExpectFx{..} | Stmt(..) | ModuleImport{..} | IngestedFileImport(_) => None,
Annotation(..) | Dbg{..} | Expect{..} | Stmt(..) | ModuleImport{..} | IngestedFileImport(_) => None,
AnnotatedBody { body_pattern, body_expr, ann_type, ann_pattern, .. } => Some((body_pattern, body_expr, Some((ann_pattern, ann_type)))),
Body (def_pattern, def_expr) => Some((def_pattern, def_expr, None)),
StmtAfterExpr => None,

View file

@ -385,18 +385,6 @@ pub fn walk_expr<V: Visitor>(visitor: &mut V, expr: &Expr, var: Variable) {
Variable::NULL,
);
}
Expr::ExpectFx {
loc_condition,
loc_continuation,
lookups_in_cond: _,
} => {
visitor.visit_expr(&loc_condition.value, loc_condition.region, Variable::BOOL);
visitor.visit_expr(
&loc_continuation.value,
loc_continuation.region,
Variable::NULL,
);
}
Expr::Dbg {
variable,
source: _,

View file

@ -24,7 +24,7 @@ use roc_can::pattern::Pattern;
use roc_can::traverse::symbols_introduced_from_pattern;
use roc_collections::all::{HumanIndex, MutMap, SendMap};
use roc_collections::VecMap;
use roc_module::ident::Lowercase;
use roc_module::ident::{IdentSuffix, Lowercase};
use roc_module::symbol::{ModuleId, Symbol};
use roc_region::all::{Loc, Region};
use roc_types::subs::{IllegalCycleMark, Variable};
@ -284,9 +284,14 @@ pub fn constrain_expr(
let (field_type, field_con) =
constrain_field(types, constraints, env, field_var, loc_field_expr);
let check_field_con =
constraints.fx_record_field_suffix(label.suffix(), field_var, field.region);
let field_con = constraints.and_constraint([field_con, check_field_con]);
let field_con = match label.suffix() {
IdentSuffix::None => {
let check_field_con =
constraints.fx_record_field_unsuffixed(field_var, field.region);
constraints.and_constraint([field_con, check_field_con])
}
IdentSuffix::Bang => field_con,
};
field_vars.push(field_var);
field_types.insert(label.clone(), RecordField::Required(field_type));
@ -787,63 +792,6 @@ pub fn constrain_expr(
constraints.exists_many(vars, all_constraints)
}
ExpectFx {
loc_condition,
loc_continuation,
lookups_in_cond,
} => {
let expected_bool = {
let bool_type = constraints.push_variable(Variable::BOOL);
constraints.push_expected_type(Expected::ForReason(
Reason::ExpectCondition,
bool_type,
loc_condition.region,
))
};
let cond_con = constrain_expr(
types,
constraints,
env,
loc_condition.region,
&loc_condition.value,
expected_bool,
);
let continuation_con = constrain_expr(
types,
constraints,
env,
loc_continuation.region,
&loc_continuation.value,
expected,
);
// + 2 for cond_con and continuation_con
let mut all_constraints = Vec::with_capacity(lookups_in_cond.len() + 2);
all_constraints.push(cond_con);
all_constraints.push(continuation_con);
let mut vars = Vec::with_capacity(lookups_in_cond.len());
for ExpectLookup {
symbol,
var,
ability_info: _,
} in lookups_in_cond.iter()
{
vars.push(*var);
let var_index = constraints.push_variable(*var);
let store_into = constraints.push_expected_type(NoExpectation(var_index));
all_constraints.push(constraints.lookup(*symbol, store_into, Region::zero()));
}
constraints.exists_many(vars, all_constraints)
}
Dbg {
source_location: _,
source: _,
@ -4427,7 +4375,6 @@ fn is_generalizable_expr(mut expr: &Expr) -> bool {
| TupleAccess { .. }
| RecordUpdate { .. }
| Expect { .. }
| ExpectFx { .. }
| Dbg { .. }
| Return { .. }
| TypedHole(_)

View file

@ -438,7 +438,6 @@ fn is_multiline_assigned_field_help<T: Formattable>(afield: &AssignedField<'_, T
| IgnoredValue(_, spaces, ann) => !spaces.is_empty() || ann.value.is_multiline(),
LabelOnly(_) => false,
AssignedField::SpaceBefore(_, _) | AssignedField::SpaceAfter(_, _) => true,
Malformed(text) => text.chars().any(|c| c == '\n'),
}
}
@ -522,9 +521,6 @@ fn format_assigned_field_help<T>(
format_assigned_field_help(sub_field, buf, indent, separator_spaces, is_multiline);
fmt_comments_only(buf, spaces.iter(), NewlineAt::Bottom, indent);
}
Malformed(raw) => {
buf.push_str(raw);
}
}
}
@ -535,7 +531,6 @@ impl<'a> Formattable for Tag<'a> {
match self {
Apply { args, .. } => args.iter().any(|arg| arg.value.is_multiline()),
Tag::SpaceBefore(_, _) | Tag::SpaceAfter(_, _) => true,
Malformed(text) => text.chars().any(|c| c == '\n'),
}
}
@ -572,10 +567,6 @@ impl<'a> Formattable for Tag<'a> {
}
}
Tag::SpaceBefore(_, _) | Tag::SpaceAfter(_, _) => unreachable!(),
Tag::Malformed(raw) => {
buf.indent(indent);
buf.push_str(raw);
}
}
}
}

View file

@ -88,6 +88,7 @@ pub fn fmt_collection<'a, 'buf, T: ExtractSpaces<'a> + Formattable>(
buf.indent(item_indent);
item.item.format(buf, item_indent);
buf.indent(item_indent);
buf.push(',');
if !item.after.is_empty() {

View file

@ -419,7 +419,6 @@ impl<'a> Formattable for ValueDef<'a> {
Body(loc_pattern, loc_expr) => loc_pattern.is_multiline() || loc_expr.is_multiline(),
AnnotatedBody { .. } => true,
Expect { condition, .. } => condition.is_multiline(),
ExpectFx { condition, .. } => condition.is_multiline(),
Dbg { condition, .. } => condition.is_multiline(),
ModuleImport(module_import) => module_import.is_multiline(),
IngestedFileImport(ingested_file_import) => ingested_file_import.is_multiline(),
@ -446,9 +445,6 @@ impl<'a> Formattable for ValueDef<'a> {
}
Dbg { condition, .. } => fmt_dbg_in_def(buf, condition, self.is_multiline(), indent),
Expect { condition, .. } => fmt_expect(buf, condition, self.is_multiline(), indent),
ExpectFx { condition, .. } => {
fmt_expect_fx(buf, condition, self.is_multiline(), indent)
}
AnnotatedBody {
ann_pattern,
ann_type,
@ -557,22 +553,6 @@ fn fmt_expect<'a>(buf: &mut Buf, condition: &'a Loc<Expr<'a>>, is_multiline: boo
condition.format(buf, return_indent);
}
fn fmt_expect_fx<'a>(buf: &mut Buf, condition: &'a Loc<Expr<'a>>, is_multiline: bool, indent: u16) {
buf.ensure_ends_with_newline();
buf.indent(indent);
buf.push_str("expect-fx");
let return_indent = if is_multiline {
buf.newline();
indent + INDENT
} else {
buf.spaces(1);
indent
};
condition.format(buf, return_indent);
}
pub fn fmt_value_def(buf: &mut Buf, def: &roc_parse::ast::ValueDef, indent: u16) {
def.format(buf, indent);
}

View file

@ -44,7 +44,6 @@ impl<'a> Formattable for Expr<'a> {
| Var { .. }
| Underscore { .. }
| MalformedIdent(_, _)
| MalformedClosure
| Tag(_)
| OpaqueRef(_)
| Crash
@ -72,9 +71,7 @@ impl<'a> Formattable for Expr<'a> {
LowLevelDbg(_, _, _) => unreachable!(
"LowLevelDbg should only exist after desugaring, not during formatting"
),
Return(return_value, after_return) => {
return_value.is_multiline() || after_return.is_some()
}
Return(_return_value, _after_return) => true,
If {
if_thens: branches,
@ -557,7 +554,6 @@ impl<'a> Formattable for Expr<'a> {
buf.indent(indent);
loc_expr.format_with_options(buf, parens, newlines, indent);
}
MalformedClosure => {}
PrecedenceConflict { .. } => {}
EmptyRecordBuilder { .. } => {}
SingleFieldRecordBuilder { .. } => {}
@ -1041,7 +1037,33 @@ fn fmt_dbg_stmt<'a>(
buf.spaces(1);
condition.format(buf, indent);
fn should_outdent(mut expr: &Expr) -> bool {
loop {
match expr {
Expr::ParensAround(_) | Expr::List(_) | Expr::Record(_) | Expr::Tuple(_) => {
return true
}
Expr::SpaceAfter(inner, _) => {
expr = inner;
}
_ => return false,
}
}
}
let inner_indent = if should_outdent(&condition.value) {
indent
} else {
indent + INDENT
};
let cond_value = condition.value.extract_spaces();
let is_defs = matches!(cond_value.item, Expr::Defs(_, _));
let newlines = if is_defs { Newlines::Yes } else { Newlines::No };
condition.format_with_options(buf, Parens::NotNeeded, newlines, inner_indent);
// Always put a blank line after the `dbg` line(s)
buf.ensure_ends_with_blank_line();
@ -1099,6 +1121,9 @@ fn fmt_return<'a>(
return_value.format(buf, return_indent);
if let Some(after_return) = after_return {
if after_return.value.extract_spaces().before.is_empty() {
buf.ensure_ends_with_newline();
}
after_return.format_with_options(buf, parens, newlines, indent);
}
}
@ -1646,9 +1671,6 @@ fn format_assigned_field_multiline<T>(
format_assigned_field_multiline(buf, sub_field, indent, separator_prefix);
fmt_comments_only(buf, spaces.iter(), NewlineAt::Top, indent);
}
Malformed(raw) => {
buf.push_str(raw);
}
}
}
@ -1686,6 +1708,7 @@ fn sub_expr_requests_parens(expr: &Expr<'_>) -> bool {
})
}
Expr::If { .. } => true,
Expr::Defs(_, _) => true,
Expr::SpaceBefore(e, _) => sub_expr_requests_parens(e),
Expr::SpaceAfter(e, _) => sub_expr_requests_parens(e),
_ => false,

View file

@ -279,7 +279,6 @@ impl<'a> LastSeenMap<'a> {
Stmt::Dbg { .. } => todo!("dbg not implemented in the dev backend"),
Stmt::Expect { .. } => todo!("expect is not implemented in the dev backend"),
Stmt::ExpectFx { .. } => todo!("expect-fx is not implemented in the dev backend"),
Stmt::Crash(msg, _crash_tag) => {
self.set_last_seen(*msg, stmt);
@ -1641,9 +1640,9 @@ trait Backend<'a> {
arg_layouts,
ret_layout,
),
LowLevel::StrSplit => self.build_fn_call(
LowLevel::StrSplitOn => self.build_fn_call(
sym,
bitcode::STR_SPLIT.to_string(),
bitcode::STR_SPLIT_ON.to_string(),
args,
arg_layouts,
ret_layout,

View file

@ -3650,74 +3650,6 @@ pub(crate) fn build_exp_stmt<'a, 'ctx>(
)
}
ExpectFx {
condition: cond_symbol,
region,
lookups,
variables,
remainder,
} => {
let bd = env.builder;
let context = env.context;
let (cond, _cond_layout) = scope.load_symbol_and_layout(cond_symbol);
let condition = bd.new_build_int_compare(
IntPredicate::EQ,
cond.into_int_value(),
context.bool_type().const_int(1, false),
"is_true",
);
let then_block = context.append_basic_block(parent, "then_block");
let throw_block = context.append_basic_block(parent, "throw_block");
bd.new_build_conditional_branch(condition, then_block, throw_block);
if env.mode.runs_expects() {
bd.position_at_end(throw_block);
match env.target.ptr_width() {
roc_target::PtrWidth::Bytes8 => {
let shared_memory = SharedMemoryPointer::get(env);
clone_to_shared_memory(
env,
layout_interner,
scope,
layout_ids,
&shared_memory,
*cond_symbol,
*region,
lookups,
variables,
);
bd.new_build_unconditional_branch(then_block);
}
roc_target::PtrWidth::Bytes4 => {
// temporary WASM implementation
throw_internal_exception(env, "An expectation failed!");
}
}
} else {
bd.position_at_end(throw_block);
bd.new_build_unconditional_branch(then_block);
}
bd.position_at_end(then_block);
build_exp_stmt(
env,
layout_interner,
layout_ids,
func_spec_solutions,
scope,
parent,
remainder,
)
}
Crash(sym, tag) => {
throw_exception(env, scope, sym, *tag);

View file

@ -471,8 +471,8 @@ pub(crate) fn run_low_level<'a, 'ctx>(
bitcode::STR_REPEAT,
)
}
StrSplit => {
// Str.split : Str, Str -> List Str
StrSplitOn => {
// Str.splitOn : Str, Str -> List Str
arguments!(string, delimiter);
call_str_bitcode_fn(
@ -480,7 +480,7 @@ pub(crate) fn run_low_level<'a, 'ctx>(
&[string, delimiter],
&[],
BitcodeReturns::List,
bitcode::STR_SPLIT,
bitcode::STR_SPLIT_ON,
)
}
StrIsEmpty => {

View file

@ -607,7 +607,6 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
Stmt::Dbg { .. } => todo!("dbg is not implemented in the wasm backend"),
Stmt::Expect { .. } => todo!("expect is not implemented in the wasm backend"),
Stmt::ExpectFx { .. } => todo!("expect-fx is not implemented in the wasm backend"),
Stmt::Crash(sym, tag) => self.stmt_crash(*sym, *tag),
}

View file

@ -200,7 +200,7 @@ impl<'a> LowLevelCall<'a> {
},
StrStartsWith => self.load_args_and_call_zig(backend, bitcode::STR_STARTS_WITH),
StrEndsWith => self.load_args_and_call_zig(backend, bitcode::STR_ENDS_WITH),
StrSplit => self.load_args_and_call_zig(backend, bitcode::STR_SPLIT),
StrSplitOn => self.load_args_and_call_zig(backend, bitcode::STR_SPLIT_ON),
StrCountUtf8Bytes => {
self.load_args_and_call_zig(backend, bitcode::STR_COUNT_UTF8_BYTES)
}

View file

@ -101,7 +101,7 @@ mod test_reporting {
use std::fs::File;
use std::io::Write;
let module_src = if src.starts_with("app") {
let module_src = if src.starts_with("app") || src.starts_with("module") {
maybe_save_parse_test_case(subdir, src, false);
// this is already a module
src.to_string()
@ -5406,7 +5406,7 @@ mod test_reporting {
2 -> 2
"
),
@r#"
@r###"
UNKNOWN OPERATOR in tmp/when_outdented_branch/Test.roc
This looks like an operator, but it's not one I recognize!
@ -5424,7 +5424,7 @@ mod test_reporting {
In Roc, functions are always written as a lambda, like
increment = \n -> n + 1
"#
"###
);
test_report!(
@ -5635,7 +5635,7 @@ mod test_reporting {
test_report!(
return_space_problem,
"return \t",
@r"
@r###"
TAB CHARACTER in tmp/return_space_problem/Test.roc
I encountered a tab character:
@ -5644,7 +5644,7 @@ mod test_reporting {
^
Tab characters are not allowed in Roc code. Please use spaces instead!
"
"###
);
test_report!(
@ -6253,7 +6253,7 @@ All branches in an `if` must have the same type!
r#"
app "broken"
packages {
pf: "https://github.com/roc-lang/basic-cli/releases/download/0.5.0/Cufzl36_SnJ4QbOoEmiJ5dIpUxBvdB3NEySvuH82Wio.tar.br",
pf: "generic-test-platform/main.roc",
}
imports [
pf.Stdout,
@ -14659,7 +14659,7 @@ All branches in an `if` must have the same type!
leftover_statement,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -14690,7 +14690,7 @@ All branches in an `if` must have the same type!
fx_fn_annotated_as_pure,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -14728,7 +14728,7 @@ All branches in an `if` must have the same type!
fx_fn_annotated_as_pure_stmt,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -14776,7 +14776,7 @@ All branches in an `if` must have the same type!
nested_function_def_fx_no_bang,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -14807,7 +14807,7 @@ All branches in an `if` must have the same type!
ignored_result_stmt,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -14839,7 +14839,7 @@ All branches in an `if` must have the same type!
ignored_stmt_forgot_to_call,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -14881,7 +14881,7 @@ All branches in an `if` must have the same type!
function_def_leftover_bang,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -14910,7 +14910,7 @@ All branches in an `if` must have the same type!
effect_in_top_level_value_def,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -14948,7 +14948,7 @@ All branches in an `if` must have the same type!
aliased_fx_fn,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -14978,7 +14978,7 @@ All branches in an `if` must have the same type!
unsuffixed_fx_in_record,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -15007,40 +15007,64 @@ All branches in an `if` must have the same type!
);
test_report!(
suffixed_pure_in_record,
unsuffixed_fx_in_record_annotation,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
module [Fx]
import pf.Effect
main! = \{} ->
notFx = {
trim!: Str.trim
}
Effect.putLine! (notFx.trim! " hello ")
Fx : {
getLine: {} => Str
}
"#
),
@r###"
@r"
MISSING EXCLAMATION in /code/proj/Main.roc
The type of this record field is an effectful function, but its name
does not indicate so:
4 getLine: {} => Str
^^^^^^^^^^^^^^^^^^
Add an exclamation mark at the end, like:
{ readFile!: Str => Str }
This will help readers identify it as a source of effects.
"
);
test_report!(
suffixed_pure_fn_in_record_annotation,
indoc!(
r#"
module [Fx]
Fx : {
getLine!: {} -> Str
}
"#
),
@r"
UNNECESSARY EXCLAMATION in /code/proj/Main.roc
This field's value is a pure function, but its name suggests
otherwise:
The type of this record field is a pure function, but its name
suggests otherwise:
7 trim!: Str.trim
^^^^^^^^^^^^^^^
4 getLine!: {} -> Str
^^^^^^^^^^^^^^^^^^^
The exclamation mark at the end is reserved for effectful functions.
Hint: Did you forget to run an effect? Is the type annotation wrong?
"###
Hint: Did you mean to use `=>` instead of `->`?
"
);
test_report!(
unsuffixed_fx_arg,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -15077,7 +15101,7 @@ All branches in an `if` must have the same type!
suffixed_pure_arg,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -15112,7 +15136,7 @@ All branches in an `if` must have the same type!
unsuffixed_tuple_fx_field,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -15156,7 +15180,7 @@ All branches in an `if` must have the same type!
suffixed_tuple_pure_field,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -15184,7 +15208,7 @@ All branches in an `if` must have the same type!
unsuffixed_tag_fx_field,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -15228,7 +15252,7 @@ All branches in an `if` must have the same type!
suffixed_tag_pure_field,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -15256,7 +15280,7 @@ All branches in an `if` must have the same type!
unsuffixed_opaque_fx_field,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -15288,7 +15312,7 @@ All branches in an `if` must have the same type!
suffixed_opaque_pure_field,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -15318,7 +15342,7 @@ All branches in an `if` must have the same type!
fx_passed_to_untyped_pure_hof,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect
@ -15361,7 +15385,7 @@ All branches in an `if` must have the same type!
fx_passed_to_partially_inferred_pure_hof,
indoc!(
r#"
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
app [main!] { pf: platform "../../../../../crates/cli/tests/test-projects/test-platform-effects-zig/main.roc" }
import pf.Effect

View file

@ -273,9 +273,6 @@ fn generate_entry_docs(
// Don't generate docs for `expect`s
}
ValueDef::ExpectFx { .. } => {
// Don't generate docs for `expect-fx`s
}
ValueDef::ModuleImport { .. } => {
// Don't generate docs for module imports
}
@ -476,7 +473,7 @@ fn contains_unexposed_type(
return true;
}
}
AssignedField::Malformed(_) | AssignedField::LabelOnly(_) => {
AssignedField::LabelOnly(_) => {
// contains no unexposed types, so continue
}
AssignedField::SpaceBefore(field, _) | AssignedField::SpaceAfter(field, _) => {
@ -524,9 +521,6 @@ fn contains_unexposed_type(
}
}
}
Tag::Malformed(_) => {
// contains no unexposed types, so continue
}
Tag::SpaceBefore(tag, _) | Tag::SpaceAfter(tag, _) => {
tags_to_process.push(*tag);
}
@ -728,7 +722,7 @@ fn record_field_to_doc(
AssignedField::LabelOnly(label) => Some(RecordField::LabelOnly {
name: label.value.to_string(),
}),
AssignedField::Malformed(_) | AssignedField::IgnoredValue(_, _, _) => None,
AssignedField::IgnoredValue(_, _, _) => None,
}
}
@ -749,7 +743,6 @@ fn tag_to_doc(in_func_ann: bool, tag: ast::Tag) -> Option<Tag> {
}),
ast::Tag::SpaceBefore(&sub_tag, _) => tag_to_doc(in_func_ann, sub_tag),
ast::Tag::SpaceAfter(&sub_tag, _) => tag_to_doc(in_func_ann, sub_tag),
ast::Tag::Malformed(_) => None,
}
}

View file

@ -68,7 +68,7 @@ use roc_solve_problem::TypeError;
use roc_target::Target;
use roc_types::subs::{CopiedImport, ExposedTypesStorageSubs, Subs, VarStore, Variable};
use roc_types::types::{Alias, Types};
use roc_worker::{ChannelProblem, WorkerMsg};
use roc_worker::ChannelProblem;
use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::collections::HashMap;
use std::io;
@ -1035,14 +1035,14 @@ type MsgSender<'a> = Sender<Msg<'a>>;
/// Add a task to the queue, and notify all the listeners.
fn enqueue_task<'a>(
injector: &Injector<BuildTask<'a>>,
listeners: &[Sender<WorkerMsg>],
listeners: &[Sender<()>],
task: BuildTask<'a>,
) -> Result<(), LoadingProblem<'a>> {
injector.push(task);
for listener in listeners {
listener
.send(WorkerMsg::TaskAdded)
.send(())
.map_err(|_| LoadingProblem::ChannelProblem(ChannelProblem::FailedToEnqueueTask))?;
}
@ -1462,6 +1462,8 @@ pub fn load<'a>(
) -> Result<LoadResult<'a>, LoadingProblem<'a>> {
enum Threads {
Single,
#[allow(dead_code)]
Many(usize),
}
@ -1567,9 +1569,9 @@ pub fn load_single_threaded<'a>(
// We'll add tasks to this, and then worker threads will take tasks from it.
let injector = Injector::new();
let (worker_msg_tx, worker_msg_rx) = bounded(1024);
let worker_listener = worker_msg_tx;
let worker_listeners = arena.alloc([worker_listener]);
let (worker_wakup_tx, worker_wakup_rx) = bounded(1024);
let worker_waker = worker_wakup_tx;
let worker_wakers = [worker_waker];
let worker = Worker::new_fifo();
let stealer = worker.stealer();
@ -1577,7 +1579,7 @@ pub fn load_single_threaded<'a>(
// now we just manually interleave stepping the state "thread" and the worker "thread"
loop {
match state_thread_step(arena, state, worker_listeners, &injector, &msg_tx, &msg_rx) {
match state_thread_step(arena, state, &worker_wakers, &injector, &msg_tx, &msg_rx) {
Ok(ControlFlow::Break(done)) => return Ok(done),
Ok(ControlFlow::Continue(new_state)) => {
state = new_state;
@ -1587,7 +1589,7 @@ pub fn load_single_threaded<'a>(
// then check if the worker can step
let control_flow =
roc_worker::worker_task_step(&worker, &injector, stealers, &worker_msg_rx, |task| {
roc_worker::worker_task_step(&worker, &injector, stealers, &worker_wakup_rx, |task| {
run_task(task, arena, &src_dir, msg_tx.clone(), roc_cache_dir, target)
});
@ -1604,7 +1606,7 @@ pub fn load_single_threaded<'a>(
fn state_thread_step<'a>(
arena: &'a Bump,
state: State<'a>,
worker_listeners: &'a [Sender<WorkerMsg>],
worker_wakers: &[Sender<()>],
injector: &Injector<BuildTask<'a>>,
msg_tx: &crossbeam::channel::Sender<Msg<'a>>,
msg_rx: &crossbeam::channel::Receiver<Msg<'a>>,
@ -1710,14 +1712,8 @@ fn state_thread_step<'a>(
let render = state.render;
let palette = state.palette;
let res_state = update(
state,
msg,
msg_tx.clone(),
injector,
worker_listeners,
arena,
);
let res_state =
update(state, msg, msg_tx.clone(), injector, worker_wakers, arena);
match res_state {
Ok(new_state) => Ok(ControlFlow::Continue(new_state)),
@ -1991,15 +1987,21 @@ fn load_multi_threaded<'a>(
{
let thread_result = thread::scope(|thread_scope| {
let mut worker_listeners =
bumpalo::collections::Vec::with_capacity_in(num_workers, arena);
// Careful! It's important that worker listeners aren't allocated in the arena,
// since they need to be correctly dropped if we have a panic in this thread::scope code.
// Making sure they're owned means they'll be dropped correctly on either normal exit
// of this thread::scope block or on panicking. When they're dropped, the worker threads
// will correctly exit their message processing loops.
// If these were allocated in the arena, we might panic without shutting down the worker threads,
// causing the thread::scope block to hang while it waits for the worker threads to exit.
let mut worker_wakers = Vec::with_capacity(num_workers);
for worker_arena in it {
let msg_tx = msg_tx.clone();
let worker = worker_queues.pop().unwrap();
let (worker_msg_tx, worker_msg_rx) = bounded(1024);
worker_listeners.push(worker_msg_tx);
let (worker_wakup_tx, worker_wakup_rx) = bounded(1024);
worker_wakers.push(worker_wakup_tx);
// We only want to move a *reference* to the main task queue's
// injector in the thread, not the injector itself
@ -2013,16 +2015,22 @@ fn load_multi_threaded<'a>(
.stack_size(EXPANDED_STACK_SIZE)
.spawn(move |_| {
// will process messages until we run out
roc_worker::worker_task(worker, injector, stealers, worker_msg_rx, |task| {
run_task(
task,
worker_arena,
src_dir,
msg_tx.clone(),
roc_cache_dir,
target,
)
})
roc_worker::worker_task(
worker,
injector,
stealers,
worker_wakup_rx,
|task| {
run_task(
task,
worker_arena,
src_dir,
msg_tx.clone(),
roc_cache_dir,
target,
)
},
)
});
res_join_handle.unwrap_or_else(|_| {
@ -2037,31 +2045,13 @@ fn load_multi_threaded<'a>(
// Grab a reference to these Senders outside the loop, so we can share
// it across each iteration of the loop.
let worker_listeners = worker_listeners.into_bump_slice();
let msg_tx = msg_tx.clone();
macro_rules! shut_down_worker_threads {
() => {
for listener in worker_listeners {
// We intentionally don't propagate this Result, because even if
// shutting down a worker failed (which can happen if a a panic
// occurred on that thread), we want to continue shutting down
// the others regardless.
if listener.send(WorkerMsg::Shutdown).is_err() {
log!("There was an error trying to shutdown a worker thread. One reason this can happen is if the thread panicked.");
}
}
};
}
// The root module will have already queued up messages to process,
// and processing those messages will in turn queue up more messages.
loop {
match state_thread_step(arena, state, worker_listeners, &injector, &msg_tx, &msg_rx)
{
match state_thread_step(arena, state, &worker_wakers, &injector, &msg_tx, &msg_rx) {
Ok(ControlFlow::Break(load_result)) => {
shut_down_worker_threads!();
return Ok(load_result);
}
Ok(ControlFlow::Continue(new_state)) => {
@ -2069,8 +2059,6 @@ fn load_multi_threaded<'a>(
continue;
}
Err(e) => {
shut_down_worker_threads!();
return Err(e);
}
}
@ -2109,13 +2097,13 @@ fn start_tasks<'a>(
state: &mut State<'a>,
work: MutSet<(ModuleId, Phase)>,
injector: &Injector<BuildTask<'a>>,
worker_listeners: &'a [Sender<WorkerMsg>],
worker_wakers: &[Sender<()>],
) -> Result<(), LoadingProblem<'a>> {
for (module_id, phase) in work {
let tasks = start_phase(module_id, phase, arena, state);
for task in tasks {
enqueue_task(injector, worker_listeners, task)?
enqueue_task(injector, worker_wakers, task)?
}
}
@ -2177,7 +2165,7 @@ fn update<'a>(
msg: Msg<'a>,
msg_tx: MsgSender<'a>,
injector: &Injector<BuildTask<'a>>,
worker_listeners: &'a [Sender<WorkerMsg>],
worker_wakers: &[Sender<()>],
arena: &'a Bump,
) -> Result<State<'a>, LoadingProblem<'a>> {
use self::Msg::*;
@ -2303,7 +2291,7 @@ fn update<'a>(
work.extend(state.dependencies.notify(home, Phase::LoadHeader));
work.insert((home, Phase::Parse));
start_tasks(arena, &mut state, work, injector, worker_listeners)?;
start_tasks(arena, &mut state, work, injector, worker_wakers)?;
Ok(state)
}
@ -2380,7 +2368,7 @@ fn update<'a>(
}
};
start_tasks(arena, &mut state, work, injector, worker_listeners)?;
start_tasks(arena, &mut state, work, injector, worker_wakers)?;
state
.module_cache
@ -2391,7 +2379,7 @@ fn update<'a>(
let work = state.dependencies.notify(module_id, Phase::Parse);
start_tasks(arena, &mut state, work, injector, worker_listeners)?;
start_tasks(arena, &mut state, work, injector, worker_wakers)?;
Ok(state)
}
@ -2443,7 +2431,7 @@ fn update<'a>(
.dependencies
.notify(module_id, Phase::CanonicalizeAndConstrain);
start_tasks(arena, &mut state, work, injector, worker_listeners)?;
start_tasks(arena, &mut state, work, injector, worker_wakers)?;
Ok(state)
}
@ -2650,7 +2638,7 @@ fn update<'a>(
work
};
start_tasks(arena, &mut state, work, injector, worker_listeners)?;
start_tasks(arena, &mut state, work, injector, worker_wakers)?;
}
Ok(state)
@ -2698,7 +2686,7 @@ fn update<'a>(
.dependencies
.notify(module_id, Phase::FindSpecializations);
start_tasks(arena, &mut state, work, injector, worker_listeners)?;
start_tasks(arena, &mut state, work, injector, worker_wakers)?;
Ok(state)
}
@ -2988,13 +2976,13 @@ fn update<'a>(
let work = state.dependencies.reload_make_specialization_pass();
start_tasks(arena, &mut state, work, injector, worker_listeners)?;
start_tasks(arena, &mut state, work, injector, worker_wakers)?;
Ok(state)
}
NextStep::MakingInPhase => {
start_tasks(arena, &mut state, work, injector, worker_listeners)?;
start_tasks(arena, &mut state, work, injector, worker_wakers)?;
Ok(state)
}
@ -3250,7 +3238,7 @@ fn finish_specialization<'a>(
.collect();
let module_id = state.root_id;
let uses_prebuilt_platform = match platform_data {
let needs_prebuilt_host = match platform_data {
Some(data) => data.is_prebuilt,
// If there's no platform data (e.g. because we're building a module)
// then there's no prebuilt platform either!
@ -3273,7 +3261,7 @@ fn finish_specialization<'a>(
timings: state.timings,
toplevel_expects,
glue_layouts: GlueLayouts { getters: vec![] },
uses_prebuilt_platform,
needs_prebuilt_host,
})
}
@ -5096,6 +5084,14 @@ fn canonicalize_and_constrain<'a>(
let mut var_store = VarStore::default();
let fx_mode = if module_id.is_builtin() {
// Allow builtins to expose effectful functions
// even if platform is `Task`-based
FxMode::PurityInference
} else {
fx_mode
};
let mut module_output = canonicalize_module_defs(
arena,
parsed_defs,

View file

@ -186,7 +186,7 @@ pub struct MonomorphizedModule<'a> {
pub sources: MutMap<ModuleId, (PathBuf, Box<str>)>,
pub timings: MutMap<ModuleId, ModuleTiming>,
pub expectations: VecMap<ModuleId, Expectations>,
pub uses_prebuilt_platform: bool,
pub needs_prebuilt_host: bool,
pub glue_layouts: GlueLayouts<'a>,
}

View file

@ -1137,15 +1137,15 @@ fn explicit_builtin_import() {
indoc!(
r"
EXPLICIT BUILTIN IMPORT in tmp/explicit_builtin_import/Main.roc
The builtin Bool was imported here:
3 import Bool
^^^^^^^^^^^
Builtins are imported automatically, so you can remove this import.
Tip: Learn more about builtins in the tutorial:
Tip: Learn more about builtins in the tutorial:
<https://www.roc-lang.org/tutorial#builtin-modules>
"
)
@ -1172,15 +1172,15 @@ fn explicit_builtin_import_empty_exposing() {
indoc!(
r"
EXPLICIT BUILTIN IMPORT in tmp/empty_exposing_builtin_import/Main.roc
The builtin Bool was imported here:
3 import Bool exposing []
^^^^^^^^^^^^^^^^^^^^^^^
Builtins are imported automatically, so you can remove this import.
Tip: Learn more about builtins in the tutorial:
Tip: Learn more about builtins in the tutorial:
<https://www.roc-lang.org/tutorial#builtin-modules>
"
)
@ -1211,16 +1211,16 @@ fn explicit_builtin_type_import() {
indoc!(
r"
EXPLICIT BUILTIN IMPORT in tmp/explicit_builtin_type_import/Main.roc
`Dict.Dict` was imported here:
3 import Dict exposing [Dict, isEmpty]
^^^^
All types from builtins are automatically exposed, so you can remove
`Dict` from the exposing list.
Tip: Learn more about builtins in the tutorial:
Tip: Learn more about builtins in the tutorial:
<https://www.roc-lang.org/tutorial#builtin-modules>
"
)
@ -2043,7 +2043,7 @@ fn module_cyclic_import_transitive() {
indoc!(
r"
module []
import Age
"
),
@ -2108,7 +2108,7 @@ fn roc_file_no_extension() {
indoc!(
r#"
app "helloWorld"
packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.16.0/O00IPk-Krg_diNS2dVWlI0ZQP794Vctxzv0ha96mK0E.tar.br" }
packages { pf: "generic-test-platform/main.roc" }
imports [pf.Stdout]
provides [main] to pf

View file

@ -361,15 +361,6 @@ impl<'a> LowerParams<'a> {
expr_stack.push(&mut loc_condition.value);
expr_stack.push(&mut loc_continuation.value);
}
ExpectFx {
loc_condition,
loc_continuation,
lookups_in_cond: _,
} => {
expr_stack.reserve(2);
expr_stack.push(&mut loc_condition.value);
expr_stack.push(&mut loc_continuation.value);
}
Dbg {
loc_message,
loc_continuation,

View file

@ -10,7 +10,7 @@ pub enum LowLevel {
StrIsEmpty,
StrStartsWith,
StrEndsWith,
StrSplit,
StrSplitOn,
StrCountUtf8Bytes,
StrFromInt,
StrFromUtf8,
@ -253,7 +253,7 @@ map_symbol_to_lowlevel! {
StrIsEmpty <= STR_IS_EMPTY;
StrStartsWith <= STR_STARTS_WITH;
StrEndsWith <= STR_ENDS_WITH;
StrSplit <= STR_SPLIT;
StrSplitOn <= STR_SPLIT_ON;
StrCountUtf8Bytes <= STR_COUNT_UTF8_BYTES;
StrFromUtf8 <= STR_FROM_UTF8_LOWLEVEL;
StrToUtf8 <= STR_TO_UTF8;

View file

@ -1371,7 +1371,7 @@ define_builtins! {
2 STR_APPEND: "#append" // unused
3 STR_CONCAT: "concat"
4 STR_JOIN_WITH: "joinWith"
5 STR_SPLIT: "split"
5 STR_SPLIT_ON: "splitOn"
6 STR_WITH_PREFIX: "withPrefix"
7 STR_STARTS_WITH: "startsWith"
8 STR_ENDS_WITH: "endsWith"
@ -1471,7 +1471,7 @@ define_builtins! {
49 LIST_SUBLIST: "sublist"
50 LIST_INTERSPERSE: "intersperse"
51 LIST_INTERSPERSE_CLOS: "#intersperseClos"
52 LIST_SPLIT: "split"
52 LIST_SPLIT_AT: "splitAt"
53 LIST_SPLIT_FIRST: "splitFirst"
54 LIST_SPLIT_LAST: "splitLast"
55 LIST_SPLIT_CLOS: "#splitClos"
@ -1509,7 +1509,11 @@ define_builtins! {
87 LIST_CLONE: "clone"
88 LIST_LEN_USIZE: "lenUsize"
89 LIST_CONCAT_UTF8: "concatUtf8"
90 LIST_WALK_FX: "walk!"
90 LIST_FOR_EACH_FX: "forEach!"
91 LIST_FOR_EACH_TRY_FX: "forEachTry!"
92 LIST_WALK_FX: "walk!"
93 LIST_SPLIT_ON: "splitOn"
94 LIST_SPLIT_ON_LIST: "splitOnList"
}
7 RESULT: "Result" => {
0 RESULT_RESULT: "Result" exposed_type=true // the Result.Result type alias
@ -1522,6 +1526,7 @@ define_builtins! {
7 RESULT_IS_OK: "isOk"
8 RESULT_MAP_BOTH: "mapBoth"
9 RESULT_MAP_TWO: "map2"
10 RESULT_ON_ERR_FX: "onErr!"
}
8 DICT: "Dict" => {
0 DICT_DICT: "Dict" exposed_type=true // the Dict.Dict type alias

View file

@ -306,7 +306,7 @@ impl<'state, 'a> State<'state, 'a> {
self.mark_owned(*s);
}
Stmt::Refcounting(_, _) => unreachable!("not inserted yet"),
Stmt::Expect { remainder, .. } | Stmt::ExpectFx { remainder, .. } => {
Stmt::Expect { remainder, .. } => {
// based on my reading of inc_dec.rs, expect borrows the symbols
self.inspect_stmt(interner, borrow_signatures, remainder);
}
@ -397,7 +397,7 @@ impl<'state, 'a> State<'state, 'a> {
"\n\tNo borrow signature for {name:?} layout.\n\n\t\
Tip 1: This can happen when you call a function with less arguments than it expects.\n\t\
Like `Arg.list!` instead of `Arg.list! {{}}`.\n\t\
Tip 2: `roc check yourfile.roc` can sometimes give you a helpful error.
Tip 2: `roc check yourfile.roc` can sometimes give you a helpful error.
"
)
};
@ -522,7 +522,6 @@ impl<'a> CallInfo<'a> {
Dbg { remainder, .. } => stack.push(remainder),
Expect { remainder, .. } => stack.push(remainder),
ExpectFx { remainder, .. } => stack.push(remainder),
Refcounting(_, _) => unreachable!("these have not been introduced yet"),

View file

@ -351,13 +351,6 @@ impl<'a, 'r> Ctx<'a, 'r> {
lookups,
variables: _,
remainder,
}
| &Stmt::ExpectFx {
condition,
region: _,
lookups,
variables: _,
remainder,
} => {
self.check_sym_layout(condition, Layout::BOOL, UseKind::ExpectCond);
for sym in lookups.iter() {

View file

@ -611,25 +611,6 @@ fn specialize_drops_stmt<'a, 'i>(
remainder,
),
}),
Stmt::ExpectFx {
condition,
region,
lookups,
variables,
remainder,
} => arena.alloc(Stmt::ExpectFx {
condition: *condition,
region: *region,
lookups,
variables,
remainder: specialize_drops_stmt(
arena,
layout_interner,
ident_ids,
environment,
remainder,
),
}),
Stmt::Dbg {
source_location,
source,
@ -1563,7 +1544,7 @@ fn low_level_no_rc(lowlevel: &LowLevel) -> RC {
StrTrim => RC::Rc,
StrTrimStart => RC::Rc,
StrTrimEnd => RC::Rc,
StrSplit => RC::NoRc,
StrSplitOn => RC::NoRc,
StrToNum => RC::NoRc,
ListPrepend => RC::Rc,
StrJoinWith => RC::NoRc,

View file

@ -182,9 +182,7 @@ impl<'a, 'i> SymbolRcTypesEnv<'a, 'i> {
Stmt::Refcounting(_, _) => unreachable!(
"Refcounting operations should not be present in the AST at this point."
),
Stmt::Expect { remainder, .. }
| Stmt::ExpectFx { remainder, .. }
| Stmt::Dbg { remainder, .. } => {
Stmt::Expect { remainder, .. } | Stmt::Dbg { remainder, .. } => {
self.insert_symbols_rc_type_stmt(remainder);
}
Stmt::Join {
@ -680,30 +678,6 @@ fn insert_refcount_operations_stmt<'v, 'a>(
remainder: newer_remainder,
})
}
Stmt::ExpectFx {
condition,
region,
lookups,
variables,
remainder,
} => {
let new_remainder = insert_refcount_operations_stmt(arena, environment, remainder);
let newer_remainder = consume_and_insert_dec_stmts(
arena,
environment,
environment.borrowed_usages(lookups.iter().copied()),
new_remainder,
);
arena.alloc(Stmt::ExpectFx {
condition: *condition,
region: *region,
lookups,
variables,
remainder: newer_remainder,
})
}
Stmt::Dbg {
source_location,
source,
@ -1274,7 +1248,7 @@ pub(crate) fn lowlevel_borrow_signature(op: LowLevel) -> &'static [Ownership] {
StrTrim => &[OWNED],
StrTrimStart => &[OWNED],
StrTrimEnd => &[OWNED],
StrSplit => &[BORROWED, BORROWED],
StrSplitOn => &[BORROWED, BORROWED],
StrToNum => &[BORROWED],
ListPrepend => &[OWNED, OWNED],
StrJoinWith => &[BORROWED, BORROWED],

View file

@ -1531,14 +1531,6 @@ pub enum Stmt<'a> {
/// what happens after the expect
remainder: &'a Stmt<'a>,
},
ExpectFx {
condition: Symbol,
region: Region,
lookups: &'a [Symbol],
variables: &'a [LookupType],
/// what happens after the expect
remainder: &'a Stmt<'a>,
},
Dbg {
/// The location this dbg is in source as a printable string.
source_location: &'a str,
@ -2279,17 +2271,6 @@ impl<'a> Stmt<'a> {
.append(alloc.hardline())
.append(remainder.to_doc(alloc, interner, pretty)),
ExpectFx {
condition,
remainder,
..
} => alloc
.text("expect-fx ")
.append(symbol_to_doc(alloc, *condition, pretty))
.append(";")
.append(alloc.hardline())
.append(remainder.to_doc(alloc, interner, pretty)),
Ret(symbol) => alloc
.text("ret ")
.append(symbol_to_doc(alloc, *symbol, pretty))
@ -4645,7 +4626,6 @@ pub fn with_hole<'a>(
EmptyRecord => let_empty_struct(assigned, hole),
Expect { .. } => unreachable!("I think this is unreachable"),
ExpectFx { .. } => unreachable!("I think this is unreachable"),
Dbg {
source_location,
source,
@ -7118,73 +7098,6 @@ pub fn from_can<'a>(
stmt
}
ExpectFx {
loc_condition,
loc_continuation,
lookups_in_cond,
} => {
let rest = from_can(env, variable, loc_continuation.value, procs, layout_cache);
let cond_symbol = env.unique_symbol();
let mut lookups = Vec::with_capacity_in(lookups_in_cond.len(), env.arena);
let mut lookup_variables = Vec::with_capacity_in(lookups_in_cond.len(), env.arena);
let mut specialized_variables = Vec::with_capacity_in(lookups_in_cond.len(), env.arena);
for ExpectLookup {
symbol,
var,
ability_info,
} in lookups_in_cond.iter().copied()
{
let symbol = match ability_info {
Some(specialization_id) => late_resolve_ability_specialization(
env,
symbol,
Some(specialization_id),
var,
),
None => symbol,
};
let expectation_subs = env
.expectation_subs
.as_deref_mut()
.expect("if expects are compiled, their subs should be available");
let spec_var = expectation_subs.fresh_unnamed_flex_var();
if !env.subs.is_function(var) {
// Exclude functions from lookups
lookups.push(symbol);
lookup_variables.push(var);
specialized_variables.push(spec_var);
}
}
let specialized_variables = specialized_variables.into_bump_slice();
let mut stmt = Stmt::ExpectFx {
condition: cond_symbol,
region: loc_condition.region,
lookups: lookups.into_bump_slice(),
variables: specialized_variables,
remainder: env.arena.alloc(rest),
};
stmt = with_hole(
env,
loc_condition.value,
Variable::BOOL,
procs,
layout_cache,
cond_symbol,
env.arena.alloc(stmt),
);
store_specialized_expectation_lookups(env, lookup_variables, specialized_variables);
stmt
}
Dbg {
source_location,
source,
@ -7721,32 +7634,6 @@ fn substitute_in_stmt_help<'a>(
Some(arena.alloc(expect))
}
ExpectFx {
condition,
region,
lookups,
variables,
remainder,
} => {
let new_remainder =
substitute_in_stmt_help(arena, remainder, subs).unwrap_or(remainder);
let new_lookups = Vec::from_iter_in(
lookups.iter().map(|s| substitute(subs, *s).unwrap_or(*s)),
arena,
);
let expect = ExpectFx {
condition: substitute(subs, *condition).unwrap_or(*condition),
region: *region,
lookups: new_lookups.into_bump_slice(),
variables,
remainder: new_remainder,
};
Some(arena.alloc(expect))
}
Jump(id, args) => {
let mut did_change = false;
let new_args = Vec::from_iter_in(

View file

@ -1790,7 +1790,7 @@ impl<'a> LambdaSet<'a> {
// functions, despite not appearing in the lambda set.
// We don't want to compile them as thunks, so we need to figure out a special-casing for
// them.
// To reproduce: test cli_run
// To reproduce: test cli_tests
//
// debug_assert!(
// self.set

View file

@ -625,31 +625,6 @@ fn insert_reset_reuse_operations_stmt<'a, 'i>(
remainder: new_remainder,
})
}
Stmt::ExpectFx {
condition,
region,
lookups,
variables,
remainder,
} => {
let new_remainder = insert_reset_reuse_operations_stmt(
arena,
layout_interner,
home,
ident_ids,
update_mode_ids,
environment,
remainder,
);
arena.alloc(Stmt::ExpectFx {
condition: *condition,
region: *region,
lookups,
variables,
remainder: new_remainder,
})
}
Stmt::Dbg {
source_location,
source,

View file

@ -377,30 +377,6 @@ fn insert_jumps<'a>(
None => None,
},
ExpectFx {
condition,
region,
lookups,
variables,
remainder,
} => match insert_jumps(
arena,
remainder,
goal_id,
needle,
needle_arguments,
needle_result,
) {
Some(cont) => Some(arena.alloc(ExpectFx {
condition: *condition,
region: *region,
lookups,
variables,
remainder: cont,
})),
None => None,
},
Ret(_) => None,
Jump(_, _) => None,
Crash(..) => None,
@ -551,9 +527,9 @@ fn trmc_candidates_help(
}
}
Stmt::Refcounting(_, next) => trmc_candidates_help(function_name, next, candidates),
Stmt::Expect { remainder, .. }
| Stmt::ExpectFx { remainder, .. }
| Stmt::Dbg { remainder, .. } => trmc_candidates_help(function_name, remainder, candidates),
Stmt::Expect { remainder, .. } | Stmt::Dbg { remainder, .. } => {
trmc_candidates_help(function_name, remainder, candidates)
}
Stmt::Join {
body, remainder, ..
} => {
@ -1010,19 +986,6 @@ impl<'a> TrmcEnv<'a> {
variables,
remainder: arena.alloc(self.walk_stmt(env, remainder)),
},
Stmt::ExpectFx {
condition,
region,
lookups,
variables,
remainder,
} => Stmt::Expect {
condition: *condition,
region: *region,
lookups,
variables,
remainder: arena.alloc(self.walk_stmt(env, remainder)),
},
Stmt::Dbg {
source_location,
source,
@ -1128,9 +1091,6 @@ fn stmt_contains_symbol_nonrec(stmt: &Stmt, needle: Symbol) -> bool {
}
Stmt::Expect {
condition, lookups, ..
}
| Stmt::ExpectFx {
condition, lookups, ..
} => needle == *condition || lookups.contains(&needle),
Stmt::Dbg { symbol, .. } => needle == *symbol,
Stmt::Join { .. } => false,

View file

@ -13,7 +13,7 @@ pub fn parse_benchmark(c: &mut Criterion) {
path.push("examples");
path.push("cli");
path.push("false-interpreter");
path.push("False.roc");
path.push("main.roc");
let src = std::fs::read_to_string(&path).unwrap();
b.iter(|| {

View file

@ -539,7 +539,6 @@ pub enum Expr<'a> {
// Problems
MalformedIdent(&'a str, crate::ident::BadIdent),
MalformedClosure,
MalformedSuffixed(&'a Loc<Expr<'a>>),
// Both operators were non-associative, e.g. (True == False == False).
// We should tell the author to disambiguate by grouping them with parens.
@ -687,7 +686,6 @@ pub fn is_expr_suffixed(expr: &Expr) -> bool {
Expr::SpaceBefore(a, _) => is_expr_suffixed(a),
Expr::SpaceAfter(a, _) => is_expr_suffixed(a),
Expr::MalformedIdent(_, _) => false,
Expr::MalformedClosure => false,
Expr::MalformedSuffixed(_) => false,
Expr::PrecedenceConflict(_) => false,
Expr::EmptyRecordBuilder(_) => false,
@ -713,7 +711,6 @@ fn is_assigned_value_suffixed<'a>(value: &AssignedField<'a, Expr<'a>>) -> bool {
AssignedField::SpaceBefore(a, _) | AssignedField::SpaceAfter(a, _) => {
is_assigned_value_suffixed(a)
}
AssignedField::Malformed(_) => false,
}
}
@ -830,11 +827,6 @@ pub enum ValueDef<'a> {
preceding_comment: Region,
},
ExpectFx {
condition: &'a Loc<Expr<'a>>,
preceding_comment: Region,
},
/// e.g. `import InternalHttp as Http exposing [Req]`.
ModuleImport(ModuleImport<'a>),
@ -889,7 +881,7 @@ impl<'a, 'b> RecursiveValueDefIter<'a, 'b> {
| OptionalValue(_, _, loc_val)
| IgnoredValue(_, _, loc_val) => break expr_stack.push(&loc_val.value),
SpaceBefore(next, _) | SpaceAfter(next, _) => current = *next,
LabelOnly(_) | Malformed(_) => break,
LabelOnly(_) => break,
}
}
}
@ -1038,7 +1030,6 @@ impl<'a, 'b> RecursiveValueDefIter<'a, 'b> {
| Tag(_)
| OpaqueRef(_)
| MalformedIdent(_, _)
| MalformedClosure
| PrecedenceConflict(_)
| MalformedSuffixed(_) => { /* terminal */ }
}
@ -1074,10 +1065,6 @@ impl<'a, 'b> Iterator for RecursiveValueDefIter<'a, 'b> {
| ValueDef::Expect {
condition,
preceding_comment: _,
}
| ValueDef::ExpectFx {
condition,
preceding_comment: _,
} => self.push_pending_from_expr(&condition.value),
ValueDef::ModuleImport(ModuleImport {
@ -1614,9 +1601,6 @@ pub enum Tag<'a> {
// We preserve this for the formatter; canonicalization ignores it.
SpaceBefore(&'a Tag<'a>, &'a [CommentOrNewline<'a>]),
SpaceAfter(&'a Tag<'a>, &'a [CommentOrNewline<'a>]),
/// A malformed tag, which will code gen to a runtime error
Malformed(&'a str),
}
#[derive(Debug, Clone, Copy, PartialEq)]
@ -1639,9 +1623,6 @@ pub enum AssignedField<'a, Val> {
// We preserve this for the formatter; canonicalization ignores it.
SpaceBefore(&'a AssignedField<'a, Val>, &'a [CommentOrNewline<'a>]),
SpaceAfter(&'a AssignedField<'a, Val>, &'a [CommentOrNewline<'a>]),
/// A malformed assigned field, which will code gen to a runtime error
Malformed(&'a str),
}
impl<'a, Val> AssignedField<'a, Val> {
@ -1653,7 +1634,7 @@ impl<'a, Val> AssignedField<'a, Val> {
Self::RequiredValue(_, _, val)
| Self::OptionalValue(_, _, val)
| Self::IgnoredValue(_, _, val) => break Some(val),
Self::LabelOnly(_) | Self::Malformed(_) => break None,
Self::LabelOnly(_) => break None,
Self::SpaceBefore(next, _) | Self::SpaceAfter(next, _) => current = *next,
}
}
@ -2518,7 +2499,6 @@ impl<'a> Malformed for Expr<'a> {
ParensAround(expr) => expr.is_malformed(),
MalformedIdent(_, _) |
MalformedClosure |
MalformedSuffixed(..) |
PrecedenceConflict(_) |
EmptyRecordBuilder(_) |
@ -2593,7 +2573,6 @@ impl<'a, T: Malformed> Malformed for AssignedField<'a, T> {
AssignedField::SpaceBefore(field, _) | AssignedField::SpaceAfter(field, _) => {
field.is_malformed()
}
AssignedField::Malformed(_) => true,
}
}
}
@ -2738,10 +2717,6 @@ impl<'a> Malformed for ValueDef<'a> {
| ValueDef::Expect {
condition,
preceding_comment: _,
}
| ValueDef::ExpectFx {
condition,
preceding_comment: _,
} => condition.is_malformed(),
ValueDef::ModuleImport(ModuleImport {
before_name: _,
@ -2815,7 +2790,6 @@ impl<'a> Malformed for Tag<'a> {
match self {
Tag::Apply { name: _, args } => args.iter().any(|arg| arg.is_malformed()),
Tag::SpaceBefore(tag, _) | Tag::SpaceAfter(tag, _) => tag.is_malformed(),
Tag::Malformed(_) => true,
}
}
}

View file

@ -2094,7 +2094,7 @@ pub fn merge_spaces<'a>(
fn expr_to_pattern_help<'a>(arena: &'a Bump, expr: &Expr<'a>) -> Result<Pattern<'a>, ()> {
let mut expr = expr.extract_spaces();
if let Expr::ParensAround(loc_expr) = &expr.item {
while let Expr::ParensAround(loc_expr) = &expr.item {
let expr_inner = loc_expr.extract_spaces();
expr.before = merge_spaces(arena, expr.before, expr_inner.before);
@ -2180,7 +2180,6 @@ fn expr_to_pattern_help<'a>(arena: &'a Bump, expr: &Expr<'a>) -> Result<Pattern<
| Expr::DbgStmt(_, _)
| Expr::LowLevelDbg(_, _, _)
| Expr::Return(_, _)
| Expr::MalformedClosure
| Expr::MalformedSuffixed(..)
| Expr::PrecedenceConflict { .. }
| Expr::EmptyRecordBuilder(_)
@ -2254,7 +2253,6 @@ fn assigned_expr_field_to_pattern_help<'a>(
arena.alloc(assigned_expr_field_to_pattern_help(arena, nested)?),
spaces,
),
AssignedField::Malformed(string) => Pattern::Malformed(string),
AssignedField::IgnoredValue(_, _, _) => return Err(()),
})
}
@ -2621,11 +2619,9 @@ fn expect_help<'a>(
preceding_comment: Region,
) -> impl Parser<'a, Stmt<'a>, EExpect<'a>> {
move |arena: &'a Bump, state: State<'a>, min_indent| {
let parse_expect_vanilla = crate::parser::keyword(crate::keyword::EXPECT, EExpect::Expect);
let parse_expect_fx = crate::parser::keyword(crate::keyword::EXPECT_FX, EExpect::Expect);
let parse_expect = either(parse_expect_vanilla, parse_expect_fx);
let parse_expect = crate::parser::keyword(crate::keyword::EXPECT, EExpect::Expect);
let (_, kw, state) = parse_expect.parse(arena, state, min_indent)?;
let (_, _kw, state) = parse_expect.parse(arena, state, min_indent)?;
let (_, condition, state) = parse_block(
options,
@ -2637,15 +2633,9 @@ fn expect_help<'a>(
)
.map_err(|(_, f)| (MadeProgress, f))?;
let vd = match kw {
Either::First(_) => ValueDef::Expect {
condition: arena.alloc(condition),
preceding_comment,
},
Either::Second(_) => ValueDef::ExpectFx {
condition: arena.alloc(condition),
preceding_comment,
},
let vd = ValueDef::Expect {
condition: arena.alloc(condition),
preceding_comment,
};
Ok((MadeProgress, Stmt::ValueDef(vd), state))

View file

@ -8,7 +8,6 @@ pub const IS: &str = "is";
pub const DBG: &str = "dbg";
pub const IMPORT: &str = "import";
pub const EXPECT: &str = "expect";
pub const EXPECT_FX: &str = "expect-fx";
pub const RETURN: &str = "return";
pub const CRASH: &str = "crash";
@ -22,6 +21,6 @@ pub const WHERE: &str = "where";
// These keywords are valid in headers
pub const PLATFORM: &str = "platform";
pub const KEYWORDS: [&str; 12] = [
IF, THEN, ELSE, WHEN, AS, IS, DBG, IMPORT, EXPECT, EXPECT_FX, RETURN, CRASH,
pub const KEYWORDS: [&str; 11] = [
IF, THEN, ELSE, WHEN, AS, IS, DBG, IMPORT, EXPECT, RETURN, CRASH,
];

View file

@ -427,13 +427,6 @@ impl<'a> Normalize<'a> for ValueDef<'a> {
condition: arena.alloc(condition.normalize(arena)),
preceding_comment: Region::zero(),
},
ExpectFx {
condition,
preceding_comment: _,
} => ExpectFx {
condition: arena.alloc(condition.normalize(arena)),
preceding_comment: Region::zero(),
},
ModuleImport(module_import) => ModuleImport(module_import.normalize(arena)),
IngestedFileImport(ingested_file_import) => {
IngestedFileImport(ingested_file_import.normalize(arena))
@ -556,7 +549,6 @@ impl<'a, T: Normalize<'a> + Copy + std::fmt::Debug> Normalize<'a> for AssignedFi
arena.alloc(c.normalize(arena)),
),
AssignedField::LabelOnly(a) => AssignedField::LabelOnly(a.normalize(arena)),
AssignedField::Malformed(a) => AssignedField::Malformed(a),
AssignedField::SpaceBefore(a, _) => a.normalize(arena),
AssignedField::SpaceAfter(a, _) => a.normalize(arena),
}
@ -784,7 +776,6 @@ impl<'a> Normalize<'a> for Expr<'a> {
a.normalize(arena)
}
Expr::MalformedIdent(a, b) => Expr::MalformedIdent(a, remove_spaces_bad_ident(b)),
Expr::MalformedClosure => Expr::MalformedClosure,
Expr::MalformedSuffixed(a) => Expr::MalformedSuffixed(a),
Expr::PrecedenceConflict(a) => Expr::PrecedenceConflict(a),
Expr::SpaceBefore(a, _) => a.normalize(arena),
@ -938,7 +929,6 @@ impl<'a> Normalize<'a> for Tag<'a> {
name: name.normalize(arena),
args: args.normalize(arena),
},
Tag::Malformed(a) => Tag::Malformed(a),
Tag::SpaceBefore(a, _) => a.normalize(arena),
Tag::SpaceAfter(a, _) => a.normalize(arena),
}

View file

@ -1056,7 +1056,11 @@ where
// the next character should not be an identifier character
// to prevent treating `whence` or `iffy` as keywords
match state.bytes().get(width) {
Some(next) if *next == b' ' || *next == b'#' || *next == b'\n' || *next == b'\r' => {
Some(
b' ' | b'#' | b'\n' | b'\r' | b'\t' | b',' | b'(' | b')' | b'[' | b']' | b'{'
| b'}' | b'"' | b'\'' | b'/' | b'\\' | b'+' | b'*' | b'%' | b'^' | b'&' | b'|'
| b'<' | b'>' | b'=' | b'!' | b'~' | b'`' | b';' | b':' | b'?' | b'.',
) => {
state = state.advance(width);
Ok((MadeProgress, (), state))
}

View file

@ -252,6 +252,8 @@ pub enum Problem {
region: Region,
},
StmtAfterExpr(Region),
UnsuffixedEffectfulRecordField(Region),
SuffixedPureRecordField(Region),
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@ -337,6 +339,9 @@ impl Problem {
Problem::StatementsAfterReturn { .. } => Warning,
Problem::ReturnAtEndOfFunction { .. } => Warning,
Problem::StmtAfterExpr(_) => Fatal,
Problem::UnsuffixedEffectfulRecordField(_) | Problem::SuffixedPureRecordField(..) => {
Warning
}
}
}
@ -430,7 +435,6 @@ impl Problem {
| Problem::RuntimeError(RuntimeError::InvalidPrecedence(_, region))
| Problem::RuntimeError(RuntimeError::MalformedIdentifier(_, _, region))
| Problem::RuntimeError(RuntimeError::MalformedTypeName(_, region))
| Problem::RuntimeError(RuntimeError::MalformedClosure(region))
| Problem::RuntimeError(RuntimeError::MalformedSuffixed(region))
| Problem::RuntimeError(RuntimeError::InvalidRecordUpdate { region })
| Problem::RuntimeError(RuntimeError::InvalidFloat(_, region, _))
@ -502,11 +506,14 @@ impl Problem {
| Problem::DefsOnlyUsedInRecursion(_, region)
| Problem::ReturnOutsideOfFunction { region }
| Problem::StatementsAfterReturn { region }
| Problem::ReturnAtEndOfFunction { region } => Some(*region),
| Problem::ReturnAtEndOfFunction { region }
| Problem::UnsuffixedEffectfulRecordField(region)
| Problem::SuffixedPureRecordField(region) => Some(*region),
Problem::RuntimeError(RuntimeError::CircularDef(cycle_entries))
| Problem::BadRecursion(cycle_entries) => {
cycle_entries.first().map(|entry| entry.expr_region)
}
Problem::StmtAfterExpr(region) => Some(*region),
Problem::RuntimeError(RuntimeError::UnresolvedTypeVar)
| Problem::RuntimeError(RuntimeError::ErroneousType)
@ -670,7 +677,6 @@ pub enum RuntimeError {
InvalidPrecedence(PrecedenceProblem, Region),
MalformedIdentifier(Box<str>, roc_parse::ident::BadIdent, Region),
MalformedTypeName(Box<str>, Region),
MalformedClosure(Region),
InvalidRecordUpdate {
region: Region,
},
@ -742,7 +748,6 @@ impl RuntimeError {
| RuntimeError::InvalidPrecedence(_, region)
| RuntimeError::MalformedIdentifier(_, _, region)
| RuntimeError::MalformedTypeName(_, region)
| RuntimeError::MalformedClosure(region)
| RuntimeError::MalformedSuffixed(region)
| RuntimeError::InvalidRecordUpdate { region }
| RuntimeError::InvalidFloat(_, region, _)

View file

@ -3,6 +3,7 @@
// See github.com/roc-lang/roc/issues/800 for discussion of the large_enum_variant check.
#![allow(clippy::large_enum_variant)]
use std::path::{Path, PathBuf};
use std::str::FromStr;
use roc_error_macros::user_error;
@ -17,6 +18,18 @@ pub enum OperatingSystem {
Windows,
}
impl std::fmt::Display for OperatingSystem {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
let arch_str = match self {
OperatingSystem::Freestanding => "freestanding",
OperatingSystem::Linux => "linux",
OperatingSystem::Mac => "macos",
OperatingSystem::Windows => "windows",
};
write!(f, "{}", arch_str)
}
}
#[repr(u8)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PtrWidth {
@ -36,8 +49,8 @@ pub enum Architecture {
impl std::fmt::Display for Architecture {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
let arch_str = match self {
Architecture::Aarch32 => "aarch32",
Architecture::Aarch64 => "aarch64",
Architecture::Aarch32 => "arm",
Architecture::Aarch64 => "arm64",
Architecture::Wasm32 => "wasm32",
Architecture::X86_32 => "x86_32",
Architecture::X86_64 => "x86_64",
@ -74,6 +87,12 @@ pub enum Target {
Wasm32,
}
#[derive(Debug, PartialEq, Eq)]
pub struct SurgicalHostArtifacts {
pub metadata: PathBuf,
pub preprocessed_host: PathBuf,
}
impl Target {
pub const fn architecture(&self) -> Architecture {
use Target::*;
@ -122,6 +141,7 @@ impl Target {
self.architecture().ptr_alignment_bytes()
}
// file extension for an object file
pub const fn object_file_ext(&self) -> &str {
use Target::*;
match self {
@ -131,6 +151,7 @@ impl Target {
}
}
// file extension for a static library file
pub const fn static_library_file_ext(&self) -> &str {
use Target::*;
match self {
@ -140,6 +161,18 @@ impl Target {
}
}
// file extension for a dynamic/shared library file
pub const fn dynamic_library_file_ext(&self) -> &str {
use Target::*;
match self {
LinuxX32 | LinuxX64 | LinuxArm64 => "so",
MacX64 | MacArm64 => "dylib",
WinX32 | WinX64 | WinArm64 => "dll",
Wasm32 => "wasm",
}
}
// file extension for an executable file
pub const fn executable_file_ext(&self) -> Option<&str> {
use Target::*;
match self {
@ -148,6 +181,137 @@ impl Target {
Wasm32 => Some("wasm"),
}
}
// file name for a prebuilt host object file
// used for legacy linking
pub fn prebuilt_static_object(&self) -> String {
use Target::*;
match self {
LinuxX32 | LinuxX64 | LinuxArm64 | MacX64 | MacArm64 | Wasm32 => {
format!("{}.o", self)
}
WinX32 | WinX64 | WinArm64 => {
format!("{}.obj", self)
}
}
}
// file name for a prebuilt host static library file
// used for legacy linking
pub fn prebuilt_static_library(&self) -> String {
use Target::*;
match self {
LinuxX32 | LinuxX64 | LinuxArm64 | MacX64 | MacArm64 | Wasm32 => {
format!("{}.a", self)
}
WinX32 | WinX64 | WinArm64 => {
format!("{}.lib", self)
}
}
}
// file name for a preprocessed host executable file
// used for surgical linking
pub fn prebuilt_surgical_host(&self) -> String {
format!("{}.rh", self) // short for roc host
}
// file name for a preprocessed host metadata file
// used for surgical linking
pub fn metadata_file_name(&self) -> String {
format!("metadata_{}.rm", self) // short for roc metadata
}
// file name for a stubbed app dynamic library file
pub fn stub_app_lib_file_name(&self) -> String {
format!("libapp.{}", self.dynamic_library_file_ext())
}
/// Search for a prebuilt legacy host in the platform main directory.
pub fn find_legacy_host(&self, platform_main_roc: &Path) -> Result<PathBuf, String> {
let static_library_path = platform_main_roc.with_file_name(self.prebuilt_static_library());
let static_object_path = platform_main_roc.with_file_name(self.prebuilt_static_object());
let generic_host_path: PathBuf = platform_main_roc
.with_file_name("libhost")
.with_extension(self.static_library_file_ext());
if static_library_path.exists() {
Ok(static_library_path)
} else if generic_host_path.exists() {
Ok(generic_host_path)
} else if static_object_path.exists() {
Ok(static_object_path)
} else {
Err(format!(
"Failed to find any legacy linking files; I need one of these three paths to exist:\n {}\n {}\n {}",
static_library_path.display(),
static_object_path.display(),
generic_host_path.display(),
)
.to_string())
}
}
/// Search for a prebuilt surgical host in the platform main directory.
pub fn find_surgical_host(
&self,
platform_main_roc: &Path,
) -> Result<SurgicalHostArtifacts, String> {
let surgical_metadata = platform_main_roc.with_file_name(self.metadata_file_name());
let surgical_host_path = platform_main_roc.with_file_name(self.prebuilt_surgical_host());
let generic_host_path: PathBuf = platform_main_roc.with_file_name("host.rh");
let generic_metadata: PathBuf = platform_main_roc.with_file_name("metadata_host.rm");
if generic_host_path.exists() && generic_metadata.exists() {
Ok(SurgicalHostArtifacts {
metadata: generic_metadata,
preprocessed_host: generic_host_path,
})
} else if surgical_host_path.exists() && surgical_metadata.exists() {
Ok(SurgicalHostArtifacts {
metadata: surgical_metadata,
preprocessed_host: surgical_host_path,
})
} else {
// TODO further improve the error message
Err(format!(
"Either the generic host files or the surgical host files must exist. \
File status: \
Generic host ({}): {}, \
Generic metadata ({}): {}, \
Surgical host ({}): {}, \
Surgical metadata ({}): {}",
generic_host_path.display(),
if generic_host_path.exists() {
"present"
} else {
"missing"
},
generic_metadata.display(),
if generic_metadata.exists() {
"present"
} else {
"missing"
},
surgical_host_path.display(),
if surgical_host_path.exists() {
"present"
} else {
"missing"
},
surgical_metadata.display(),
if surgical_metadata.exists() {
"present"
} else {
"missing"
}
))
}
}
}
pub enum ParseError {

View file

@ -3863,7 +3863,7 @@ mod solve_expr {
#[test]
fn list_split() {
infer_eq_without_problem(
indoc!("List.split"),
indoc!("List.splitAt"),
"List elem, U64 -> { before : List elem, others : List elem }",
);
}

View file

@ -371,10 +371,10 @@ fn list_map_try_err() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn list_split() {
fn list_split_at() {
assert_evals_to!(
r"
list = List.split [1, 2, 3] 0
list = List.splitAt [1, 2, 3] 0
list.before
",
RocList::<i64>::from_slice(&[]),
@ -382,7 +382,7 @@ fn list_split() {
);
assert_evals_to!(
r"
list = List.split [1, 2, 3] 0
list = List.splitAt [1, 2, 3] 0
list.others
",
RocList::from_slice(&[1, 2, 3]),
@ -390,13 +390,13 @@ fn list_split() {
);
assert_evals_to!(
r"
List.split [1, 2, 3] 1
List.splitAt [1, 2, 3] 1
",
(RocList::from_slice(&[1]), RocList::from_slice(&[2, 3])),
(RocList<i64>, RocList<i64>,)
);
assert_evals_to!(
"List.split [1, 2, 3] 3",
"List.splitAt [1, 2, 3] 3",
(
RocList::from_slice(&[1, 2, 3]),
RocList::<i64>::from_slice(&[]),
@ -404,7 +404,7 @@ fn list_split() {
(RocList<i64>, RocList<i64>,)
);
assert_evals_to!(
"List.split [1, 2, 3] 4",
"List.splitAt [1, 2, 3] 4",
(
RocList::from_slice(&[1, 2, 3]),
RocList::<i64>::from_slice(&[]),
@ -412,7 +412,7 @@ fn list_split() {
(RocList<i64>, RocList<i64>,)
);
assert_evals_to!(
"List.split [] 1",
"List.splitAt [] 1",
(
RocList::<i64>::from_slice(&[]),
RocList::<i64>::from_slice(&[]),
@ -421,6 +421,133 @@ fn list_split() {
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn list_split_on() {
assert_evals_to!(
r"
List.splitOn [] 1
",
RocList::<RocList<i64>>::from_slice(&[RocList::<i64>::from_slice(&[])]),
RocList<RocList<i64>>
);
assert_evals_to!(
r"
List.splitOn [1] 1
",
RocList::<RocList<i64>>::from_slice(&[
RocList::<i64>::from_slice(&[]),
RocList::<i64>::from_slice(&[]),
]),
RocList<RocList<i64>>
);
assert_evals_to!(
r"
List.splitOn [1, 2, 3] 47
",
RocList::<RocList<i64>>::from_slice(&[RocList::<i64>::from_slice(&[1, 2, 3])]),
RocList<RocList<i64>>
);
assert_evals_to!(
r"
List.splitOn [1, 2, 3, 4, 5] 3
",
RocList::<RocList<i64>>::from_slice(&[
RocList::<i64>::from_slice(&[1, 2]),
RocList::<i64>::from_slice(&[4, 5]),
]),
RocList<RocList<i64>>
);
assert_evals_to!(
r"
List.splitOn [1, 0, 1, 0, 1] 1
",
RocList::<RocList<i64>>::from_slice(&[
RocList::<i64>::from_slice(&[]),
RocList::<i64>::from_slice(&[0]),
RocList::<i64>::from_slice(&[0]),
RocList::<i64>::from_slice(&[]),
]),
RocList<RocList<i64>>
);
assert_evals_to!(
r"
List.splitOn [1, 0, 1, 0, 1] 0
",
RocList::<RocList<i64>>::from_slice(&[
RocList::<i64>::from_slice(&[1]),
RocList::<i64>::from_slice(&[1]),
RocList::<i64>::from_slice(&[1]),
]),
RocList<RocList<i64>>
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn list_split_on_list() {
assert_evals_to!(
r"
List.splitOnList [] []
",
RocList::<RocList<i64>>::from_slice(&[RocList::<i64>::from_slice(&[])]),
RocList<RocList<i64>>
);
assert_evals_to!(
r"
List.splitOnList [] [1, 2, 3]
",
RocList::<RocList<i64>>::from_slice(&[RocList::<i64>::from_slice(&[]),]),
RocList<RocList<i64>>
);
assert_evals_to!(
r"
List.splitOnList [1, 2, 3] []
",
RocList::<RocList<i64>>::from_slice(&[RocList::<i64>::from_slice(&[1, 2, 3]),]),
RocList<RocList<i64>>
);
assert_evals_to!(
r"
List.splitOnList [1] [1]
",
RocList::<RocList<i64>>::from_slice(&[
RocList::<i64>::from_slice(&[]),
RocList::<i64>::from_slice(&[]),
]),
RocList<RocList<i64>>
);
assert_evals_to!(
r"
List.splitOnList [1, 2, 3] [47]
",
RocList::<RocList<i64>>::from_slice(&[RocList::<i64>::from_slice(&[1, 2, 3])]),
RocList<RocList<i64>>
);
assert_evals_to!(
r"
List.splitOnList [1, 2, 3, 4, 5] [2, 3]
",
RocList::<RocList<i64>>::from_slice(&[
RocList::<i64>::from_slice(&[1]),
RocList::<i64>::from_slice(&[4, 5]),
]),
RocList<RocList<i64>>
);
assert_evals_to!(
r"
List.splitOnList [1, 0, 1, 0, 1] [1]
",
RocList::<RocList<i64>>::from_slice(&[
RocList::<i64>::from_slice(&[]),
RocList::<i64>::from_slice(&[0]),
RocList::<i64>::from_slice(&[0]),
RocList::<i64>::from_slice(&[]),
]),
RocList<RocList<i64>>
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn list_split_first() {
@ -3172,7 +3299,7 @@ fn list_join_map() {
assert_evals_to!(
indoc!(
r#"
List.joinMap ["guava,apple,pear", "bailey,cyrus"] (\s -> Str.split s ",")
List.joinMap ["guava,apple,pear", "bailey,cyrus"] (\s -> Str.splitOn s ",")
"#
),
RocList::from_slice(&[
@ -3192,7 +3319,7 @@ fn list_join_map_empty() {
assert_evals_to!(
indoc!(
r#"
List.joinMap [] (\s -> Str.split s ",")
List.joinMap [] (\s -> Str.splitOn s ",")
"#
),
RocList::from_slice(&[]),

View file

@ -220,13 +220,13 @@ fn list_str_take_first() {
#[test]
#[cfg(feature = "gen-wasm")]
fn list_str_split() {
fn list_str_split_on() {
assert_refcounts!(
indoc!(
r#"
s = Str.concat "A long enough string " "to be heap-allocated"
list = [s, s, s]
List.split list 1
List.splitAt list 1
"#
),
(RocList<RocStr>, RocList<RocStr>),
@ -239,13 +239,13 @@ fn list_str_split() {
#[test]
#[cfg(feature = "gen-wasm")]
fn list_str_split_zero() {
fn list_str_split_on_zero() {
assert_refcounts!(
indoc!(
r#"
s = Str.concat "A long enough string " "to be heap-allocated"
list = [s, s, s]
List.split list 0
List.splitAt list 0
"#
),
(RocList<RocStr>, RocList<RocStr>),

View file

@ -51,11 +51,11 @@ fn string_neq() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_empty_delimiter() {
fn str_split_on_empty_delimiter() {
assert_evals_to!(
indoc!(
r#"
List.len (Str.split "hello" "")
List.len (Str.splitOn "hello" "")
"#
),
1,
@ -65,7 +65,7 @@ fn str_split_empty_delimiter() {
assert_evals_to!(
indoc!(
r#"
when List.first (Str.split "JJJ" "") is
when List.first (Str.splitOn "JJJ" "") is
Ok str ->
Str.countUtf8Bytes str
@ -81,11 +81,11 @@ fn str_split_empty_delimiter() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_bigger_delimiter_small_str() {
fn str_split_on_bigger_delimiter_small_str() {
assert_evals_to!(
indoc!(
r#"
List.len (Str.split "hello" "JJJJ there")
List.len (Str.splitOn "hello" "JJJJ there")
"#
),
1,
@ -95,7 +95,7 @@ fn str_split_bigger_delimiter_small_str() {
assert_evals_to!(
indoc!(
r#"
when List.first (Str.split "JJJ" "JJJJ there") is
when List.first (Str.splitOn "JJJ" "JJJJ there") is
Ok str ->
Str.countUtf8Bytes str
@ -111,11 +111,11 @@ fn str_split_bigger_delimiter_small_str() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_str_concat_repeated() {
fn str_split_on_str_concat_repeated() {
assert_evals_to!(
indoc!(
r#"
when List.first (Str.split "JJJJJ" "JJJJ there") is
when List.first (Str.splitOn "JJJJJ" "JJJJ there") is
Ok str ->
str
|> Str.concat str
@ -135,9 +135,9 @@ fn str_split_str_concat_repeated() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_small_str_bigger_delimiter() {
fn str_split_on_small_str_bigger_delimiter() {
assert_evals_to!(
indoc!(r#"Str.split "JJJ" "0123456789abcdefghi""#),
indoc!(r#"Str.splitOn "JJJ" "0123456789abcdefghi""#),
RocList::from_slice(&[RocStr::from("JJJ")]),
RocList<RocStr>
);
@ -145,11 +145,11 @@ fn str_split_small_str_bigger_delimiter() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_big_str_small_delimiter() {
fn str_split_on_big_str_small_delimiter() {
assert_evals_to!(
indoc!(
r#"
Str.split "01234567789abcdefghi?01234567789abcdefghi" "?"
Str.splitOn "01234567789abcdefghi?01234567789abcdefghi" "?"
"#
),
RocList::from_slice(&[
@ -162,7 +162,7 @@ fn str_split_big_str_small_delimiter() {
assert_evals_to!(
indoc!(
r#"
Str.split "01234567789abcdefghi 3ch 01234567789abcdefghi" "3ch"
Str.splitOn "01234567789abcdefghi 3ch 01234567789abcdefghi" "3ch"
"#
),
RocList::from_slice(&[
@ -175,11 +175,11 @@ fn str_split_big_str_small_delimiter() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_small_str_small_delimiter() {
fn str_split_on_small_str_small_delimiter() {
assert_evals_to!(
indoc!(
r#"
Str.split "J!J!J" "!"
Str.splitOn "J!J!J" "!"
"#
),
RocList::from_slice(&[RocStr::from("J"), RocStr::from("J"), RocStr::from("J")]),
@ -189,11 +189,11 @@ fn str_split_small_str_small_delimiter() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_bigger_delimiter_big_strs() {
fn str_split_on_bigger_delimiter_big_strs() {
assert_evals_to!(
indoc!(
r#"
Str.split
Str.splitOn
"string to split is shorter"
"than the delimiter which happens to be very very long"
"#
@ -205,11 +205,11 @@ fn str_split_bigger_delimiter_big_strs() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_empty_strs() {
fn str_split_on_empty_strs() {
assert_evals_to!(
indoc!(
r#"
Str.split "" ""
Str.splitOn "" ""
"#
),
RocList::from_slice(&[RocStr::from("")]),
@ -219,11 +219,11 @@ fn str_split_empty_strs() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_minimal_example() {
fn str_split_on_minimal_example() {
assert_evals_to!(
indoc!(
r#"
Str.split "a," ","
Str.splitOn "a," ","
"#
),
RocList::from_slice(&[RocStr::from("a"), RocStr::from("")]),
@ -233,11 +233,11 @@ fn str_split_minimal_example() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_small_str_big_delimiter() {
fn str_split_on_small_str_big_delimiter() {
assert_evals_to!(
indoc!(
r#"
Str.split
Str.splitOn
"1---- ---- ---- ---- ----2---- ---- ---- ---- ----"
"---- ---- ---- ---- ----"
|> List.len
@ -250,7 +250,7 @@ fn str_split_small_str_big_delimiter() {
assert_evals_to!(
indoc!(
r#"
Str.split
Str.splitOn
"1---- ---- ---- ---- ----2---- ---- ---- ---- ----"
"---- ---- ---- ---- ----"
"#
@ -262,11 +262,11 @@ fn str_split_small_str_big_delimiter() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_small_str_20_char_delimiter() {
fn str_split_on_small_str_20_char_delimiter() {
assert_evals_to!(
indoc!(
r#"
Str.split
Str.splitOn
"3|-- -- -- -- -- -- |4|-- -- -- -- -- -- |"
"|-- -- -- -- -- -- |"
"#
@ -1548,7 +1548,7 @@ fn issue_2811() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_first_one_char() {
fn str_split_on_first_one_char() {
assert_evals_to!(
indoc!(
r#"
@ -1564,7 +1564,7 @@ fn str_split_first_one_char() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_first_multiple_chars() {
fn str_split_on_first_multiple_chars() {
assert_evals_to!(
indoc!(
r#"
@ -1578,7 +1578,7 @@ fn str_split_first_multiple_chars() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_first_entire_input() {
fn str_split_on_first_entire_input() {
assert_evals_to!(
indoc!(
r#"
@ -1592,7 +1592,7 @@ fn str_split_first_entire_input() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_first_not_found() {
fn str_split_on_first_not_found() {
assert_evals_to!(
indoc!(
r#"
@ -1606,7 +1606,7 @@ fn str_split_first_not_found() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_last_one_char() {
fn str_split_on_last_one_char() {
assert_evals_to!(
indoc!(
r#"
@ -1620,7 +1620,7 @@ fn str_split_last_one_char() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_last_multiple_chars() {
fn str_split_on_last_multiple_chars() {
assert_evals_to!(
indoc!(
r#"
@ -1634,7 +1634,7 @@ fn str_split_last_multiple_chars() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_last_entire_input() {
fn str_split_on_last_entire_input() {
assert_evals_to!(
indoc!(
r#"
@ -1648,7 +1648,7 @@ fn str_split_last_entire_input() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_last_not_found() {
fn str_split_on_last_not_found() {
assert_evals_to!(
indoc!(
r#"
@ -1662,9 +1662,9 @@ fn str_split_last_not_found() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_overlapping_substring_1() {
fn str_split_on_overlapping_substring_1() {
assert_evals_to!(
r#"Str.split "aaa" "aa""#,
r#"Str.splitOn "aaa" "aa""#,
RocList::from_slice(&[RocStr::from(""), RocStr::from("a")]),
RocList<RocStr>
);
@ -1672,9 +1672,9 @@ fn str_split_overlapping_substring_1() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_overlapping_substring_2() {
fn str_split_on_overlapping_substring_2() {
assert_evals_to!(
r#"Str.split "aaaa" "aa""#,
r#"Str.splitOn "aaaa" "aa""#,
RocList::from_slice(&[RocStr::from(""), RocStr::from(""), RocStr::from("")]),
RocList<RocStr>
);

View file

@ -15,11 +15,11 @@ use indoc::indoc;
use roc_std::{RocList, RocStr, I128, U128};
#[test]
fn str_split_empty_delimiter() {
fn str_split_on_empty_delimiter() {
assert_evals_to!(
indoc!(
r#"
List.len (Str.split "hello" "")
List.len (Str.splitOn "hello" "")
"#
),
1,
@ -28,11 +28,11 @@ fn str_split_empty_delimiter() {
}
#[test]
fn str_split_bigger_delimiter_small_str() {
fn str_split_on_bigger_delimiter_small_str() {
assert_evals_to!(
indoc!(
r#"
List.len (Str.split "hello" "JJJJ there")
List.len (Str.splitOn "hello" "JJJJ there")
"#
),
1,
@ -41,11 +41,11 @@ fn str_split_bigger_delimiter_small_str() {
}
#[test]
fn str_split_str_concat_repeated() {
fn str_split_on_str_concat_repeated() {
assert_evals_to!(
indoc!(
r#"
when List.first (Str.split "JJJJJ" "JJJJ there") is
when List.first (Str.splitOn "JJJJJ" "JJJJ there") is
Ok str ->
str
|> Str.concat str
@ -64,13 +64,13 @@ fn str_split_str_concat_repeated() {
}
#[test]
fn str_split_small_str_bigger_delimiter() {
fn str_split_on_small_str_bigger_delimiter() {
assert_evals_to!(
indoc!(
r#"
when
List.first
(Str.split "JJJ" "0123456789abcdefghi")
(Str.splitOn "JJJ" "0123456789abcdefghi")
is
Ok str -> str
_ -> ""
@ -82,11 +82,11 @@ fn str_split_small_str_bigger_delimiter() {
}
#[test]
fn str_split_big_str_small_delimiter() {
fn str_split_on_big_str_small_delimiter() {
assert_evals_to!(
indoc!(
r#"
Str.split "01234567789abcdefghi?01234567789abcdefghi" "?"
Str.splitOn "01234567789abcdefghi?01234567789abcdefghi" "?"
"#
),
RocList::from_slice(&[
@ -99,7 +99,7 @@ fn str_split_big_str_small_delimiter() {
assert_evals_to!(
indoc!(
r#"
Str.split "01234567789abcdefghi 3ch 01234567789abcdefghi" "3ch"
Str.splitOn "01234567789abcdefghi 3ch 01234567789abcdefghi" "3ch"
"#
),
RocList::from_slice(&[
@ -111,11 +111,11 @@ fn str_split_big_str_small_delimiter() {
}
#[test]
fn str_split_small_str_small_delimiter() {
fn str_split_on_small_str_small_delimiter() {
assert_evals_to!(
indoc!(
r#"
Str.split "J!J!J" "!"
Str.splitOn "J!J!J" "!"
"#
),
RocList::from_slice(&[RocStr::from("J"), RocStr::from("J"), RocStr::from("J")]),
@ -124,11 +124,11 @@ fn str_split_small_str_small_delimiter() {
}
#[test]
fn str_split_bigger_delimiter_big_strs() {
fn str_split_on_bigger_delimiter_big_strs() {
assert_evals_to!(
indoc!(
r#"
Str.split
Str.splitOn
"string to split is shorter"
"than the delimiter which happens to be very very long"
"#
@ -139,11 +139,11 @@ fn str_split_bigger_delimiter_big_strs() {
}
#[test]
fn str_split_empty_strs() {
fn str_split_on_empty_strs() {
assert_evals_to!(
indoc!(
r#"
Str.split "" ""
Str.splitOn "" ""
"#
),
RocList::from_slice(&[RocStr::from("")]),
@ -152,11 +152,11 @@ fn str_split_empty_strs() {
}
#[test]
fn str_split_minimal_example() {
fn str_split_on_minimal_example() {
assert_evals_to!(
indoc!(
r#"
Str.split "a," ","
Str.splitOn "a," ","
"#
),
RocList::from_slice(&[RocStr::from("a"), RocStr::from("")]),
@ -165,11 +165,11 @@ fn str_split_minimal_example() {
}
#[test]
fn str_split_small_str_big_delimiter() {
fn str_split_on_small_str_big_delimiter() {
assert_evals_to!(
indoc!(
r#"
Str.split
Str.splitOn
"1---- ---- ---- ---- ----2---- ---- ---- ---- ----"
"---- ---- ---- ---- ----"
|> List.len
@ -182,7 +182,7 @@ fn str_split_small_str_big_delimiter() {
assert_evals_to!(
indoc!(
r#"
Str.split
Str.splitOn
"1---- ---- ---- ---- ----2---- ---- ---- ---- ----"
"---- ---- ---- ---- ----"
"#
@ -193,11 +193,11 @@ fn str_split_small_str_big_delimiter() {
}
#[test]
fn str_split_small_str_20_char_delimiter() {
fn str_split_on_small_str_20_char_delimiter() {
assert_evals_to!(
indoc!(
r#"
Str.split
Str.splitOn
"3|-- -- -- -- -- -- |4|-- -- -- -- -- -- |"
"|-- -- -- -- -- -- |"
"#

View file

@ -2,81 +2,81 @@ procedure Bool.11 (#Attr.2, #Attr.3):
let Bool.23 : Int1 = lowlevel Eq #Attr.2 #Attr.3;
ret Bool.23;
procedure List.111 (List.540, List.541, List.542):
let List.644 : U64 = 0i64;
let List.645 : U64 = CallByName List.6 List.540;
let List.643 : [C U64, C U64] = CallByName List.80 List.540 List.541 List.542 List.644 List.645;
ret List.643;
procedure List.115 (List.562, List.563, List.564):
let List.677 : U64 = 0i64;
let List.678 : U64 = CallByName List.6 List.562;
let List.676 : [C U64, C U64] = CallByName List.80 List.562 List.563 List.564 List.677 List.678;
ret List.676;
procedure List.26 (List.208, List.209, List.210):
let List.637 : [C U64, C U64] = CallByName List.111 List.208 List.209 List.210;
let List.640 : U8 = 1i64;
let List.641 : U8 = GetTagId List.637;
let List.642 : Int1 = lowlevel Eq List.640 List.641;
if List.642 then
let List.211 : U64 = UnionAtIndex (Id 1) (Index 0) List.637;
ret List.211;
procedure List.26 (List.212, List.213, List.214):
let List.670 : [C U64, C U64] = CallByName List.115 List.212 List.213 List.214;
let List.673 : U8 = 1i64;
let List.674 : U8 = GetTagId List.670;
let List.675 : Int1 = lowlevel Eq List.673 List.674;
if List.675 then
let List.215 : U64 = UnionAtIndex (Id 1) (Index 0) List.670;
ret List.215;
else
let List.212 : U64 = UnionAtIndex (Id 0) (Index 0) List.637;
ret List.212;
let List.216 : U64 = UnionAtIndex (Id 0) (Index 0) List.670;
ret List.216;
procedure List.38 (List.396, List.397):
let List.636 : U64 = CallByName List.6 List.396;
let List.398 : U64 = CallByName Num.77 List.636 List.397;
let List.626 : List U8 = CallByName List.43 List.396 List.398;
ret List.626;
procedure List.38 (List.400, List.401):
let List.669 : U64 = CallByName List.6 List.400;
let List.402 : U64 = CallByName Num.77 List.669 List.401;
let List.659 : List U8 = CallByName List.43 List.400 List.402;
ret List.659;
procedure List.43 (List.394, List.395):
let List.634 : U64 = CallByName List.6 List.394;
let List.633 : U64 = CallByName Num.77 List.634 List.395;
let List.628 : {U64, U64} = Struct {List.395, List.633};
let List.627 : List U8 = CallByName List.49 List.394 List.628;
ret List.627;
procedure List.43 (List.398, List.399):
let List.667 : U64 = CallByName List.6 List.398;
let List.666 : U64 = CallByName Num.77 List.667 List.399;
let List.661 : {U64, U64} = Struct {List.399, List.666};
let List.660 : List U8 = CallByName List.49 List.398 List.661;
ret List.660;
procedure List.49 (List.472, List.473):
let List.630 : U64 = StructAtIndex 1 List.473;
let List.631 : U64 = StructAtIndex 0 List.473;
let List.629 : List U8 = CallByName List.72 List.472 List.630 List.631;
ret List.629;
procedure List.49 (List.476, List.477):
let List.663 : U64 = StructAtIndex 1 List.477;
let List.664 : U64 = StructAtIndex 0 List.477;
let List.662 : List U8 = CallByName List.72 List.476 List.663 List.664;
ret List.662;
procedure List.6 (#Attr.2):
let List.635 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.635;
let List.668 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.668;
procedure List.66 (#Attr.2, #Attr.3):
let List.658 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.658;
let List.691 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.691;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.632 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.632;
let List.665 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.665;
procedure List.80 (#Derived_gen.0, #Derived_gen.1, #Derived_gen.2, #Derived_gen.3, #Derived_gen.4):
joinpoint List.646 List.543 List.544 List.545 List.546 List.547:
let List.648 : Int1 = CallByName Num.22 List.546 List.547;
if List.648 then
let List.657 : U8 = CallByName List.66 List.543 List.546;
let List.649 : [C U64, C U64] = CallByName Test.4 List.544 List.657;
let List.654 : U8 = 1i64;
let List.655 : U8 = GetTagId List.649;
let List.656 : Int1 = lowlevel Eq List.654 List.655;
if List.656 then
let List.548 : U64 = UnionAtIndex (Id 1) (Index 0) List.649;
let List.652 : U64 = 1i64;
let List.651 : U64 = CallByName Num.51 List.546 List.652;
jump List.646 List.543 List.548 List.545 List.651 List.547;
joinpoint List.679 List.565 List.566 List.567 List.568 List.569:
let List.681 : Int1 = CallByName Num.22 List.568 List.569;
if List.681 then
let List.690 : U8 = CallByName List.66 List.565 List.568;
let List.682 : [C U64, C U64] = CallByName Test.4 List.566 List.690;
let List.687 : U8 = 1i64;
let List.688 : U8 = GetTagId List.682;
let List.689 : Int1 = lowlevel Eq List.687 List.688;
if List.689 then
let List.570 : U64 = UnionAtIndex (Id 1) (Index 0) List.682;
let List.685 : U64 = 1i64;
let List.684 : U64 = CallByName Num.51 List.568 List.685;
jump List.679 List.565 List.570 List.567 List.684 List.569;
else
dec List.543;
let List.549 : U64 = UnionAtIndex (Id 0) (Index 0) List.649;
let List.653 : [C U64, C U64] = TagId(0) List.549;
ret List.653;
dec List.565;
let List.571 : U64 = UnionAtIndex (Id 0) (Index 0) List.682;
let List.686 : [C U64, C U64] = TagId(0) List.571;
ret List.686;
else
dec List.543;
let List.647 : [C U64, C U64] = TagId(1) List.544;
ret List.647;
dec List.565;
let List.680 : [C U64, C U64] = TagId(1) List.566;
ret List.680;
in
inc #Derived_gen.0;
jump List.646 #Derived_gen.0 #Derived_gen.1 #Derived_gen.2 #Derived_gen.3 #Derived_gen.4;
jump List.679 #Derived_gen.0 #Derived_gen.1 #Derived_gen.2 #Derived_gen.3 #Derived_gen.4;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.284 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,51 +1,51 @@
procedure List.18 (List.167, List.168, List.169):
let List.630 : U64 = 0i64;
let List.631 : U64 = CallByName List.6 List.167;
let List.629 : List {} = CallByName List.96 List.167 List.168 List.169 List.630 List.631;
ret List.629;
procedure List.279 (List.280, List.281, List.277):
let List.643 : {} = CallByName Test.2 List.281;
let List.642 : List {} = CallByName List.71 List.280 List.643;
ret List.642;
procedure List.5 (List.276, List.277):
let List.278 : U64 = CallByName List.6 List.276;
let List.627 : List {} = CallByName List.68 List.278;
let List.626 : List {} = CallByName List.18 List.276 List.627 List.277;
ret List.626;
procedure List.6 (#Attr.2):
let List.640 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.640;
procedure List.66 (#Attr.2, #Attr.3):
let List.639 : [] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.639;
procedure List.68 (#Attr.2):
let List.645 : List {} = lowlevel ListWithCapacity #Attr.2;
ret List.645;
procedure List.71 (#Attr.2, #Attr.3):
let List.644 : List {} = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.644;
procedure List.96 (#Derived_gen.0, #Derived_gen.1, #Derived_gen.2, #Derived_gen.3, #Derived_gen.4):
joinpoint List.632 List.170 List.171 List.172 List.173 List.174:
let List.634 : Int1 = CallByName Num.22 List.173 List.174;
if List.634 then
let List.638 : [] = CallByName List.66 List.170 List.173;
let List.175 : List {} = CallByName List.279 List.171 List.638 List.172;
let List.637 : U64 = 1i64;
let List.636 : U64 = CallByName Num.51 List.173 List.637;
jump List.632 List.170 List.175 List.172 List.636 List.174;
procedure List.100 (#Derived_gen.0, #Derived_gen.1, #Derived_gen.2, #Derived_gen.3, #Derived_gen.4):
joinpoint List.665 List.174 List.175 List.176 List.177 List.178:
let List.667 : Int1 = CallByName Num.22 List.177 List.178;
if List.667 then
let List.671 : [] = CallByName List.66 List.174 List.177;
let List.179 : List {} = CallByName List.283 List.175 List.671 List.176;
let List.670 : U64 = 1i64;
let List.669 : U64 = CallByName Num.51 List.177 List.670;
jump List.665 List.174 List.179 List.176 List.669 List.178;
else
dec List.170;
ret List.171;
dec List.174;
ret List.175;
in
inc #Derived_gen.0;
jump List.632 #Derived_gen.0 #Derived_gen.1 #Derived_gen.2 #Derived_gen.3 #Derived_gen.4;
jump List.665 #Derived_gen.0 #Derived_gen.1 #Derived_gen.2 #Derived_gen.3 #Derived_gen.4;
procedure List.18 (List.171, List.172, List.173):
let List.663 : U64 = 0i64;
let List.664 : U64 = CallByName List.6 List.171;
let List.662 : List {} = CallByName List.100 List.171 List.172 List.173 List.663 List.664;
ret List.662;
procedure List.283 (List.284, List.285, List.281):
let List.676 : {} = CallByName Test.2 List.285;
let List.675 : List {} = CallByName List.71 List.284 List.676;
ret List.675;
procedure List.5 (List.280, List.281):
let List.282 : U64 = CallByName List.6 List.280;
let List.660 : List {} = CallByName List.68 List.282;
let List.659 : List {} = CallByName List.18 List.280 List.660 List.281;
ret List.659;
procedure List.6 (#Attr.2):
let List.673 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.673;
procedure List.66 (#Attr.2, #Attr.3):
let List.672 : [] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.672;
procedure List.68 (#Attr.2):
let List.678 : List {} = lowlevel ListWithCapacity #Attr.2;
ret List.678;
procedure List.71 (#Attr.2, #Attr.3):
let List.677 : List {} = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.677;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.282 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,51 +1,51 @@
procedure List.18 (List.167, List.168, List.169):
let List.630 : U64 = 0i64;
let List.631 : U64 = CallByName List.6 List.167;
let List.629 : List [] = CallByName List.96 List.167 List.168 List.169 List.630 List.631;
ret List.629;
procedure List.279 (List.280, List.281, List.277):
let List.643 : [] = CallByName Test.2 List.281;
let List.642 : List [] = CallByName List.71 List.280 List.643;
ret List.642;
procedure List.5 (List.276, List.277):
let List.278 : U64 = CallByName List.6 List.276;
let List.627 : List [] = CallByName List.68 List.278;
let List.626 : List [] = CallByName List.18 List.276 List.627 List.277;
ret List.626;
procedure List.6 (#Attr.2):
let List.640 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.640;
procedure List.66 (#Attr.2, #Attr.3):
let List.639 : [] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.639;
procedure List.68 (#Attr.2):
let List.645 : List [] = lowlevel ListWithCapacity #Attr.2;
ret List.645;
procedure List.71 (#Attr.2, #Attr.3):
let List.644 : List [] = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.644;
procedure List.96 (#Derived_gen.0, #Derived_gen.1, #Derived_gen.2, #Derived_gen.3, #Derived_gen.4):
joinpoint List.632 List.170 List.171 List.172 List.173 List.174:
let List.634 : Int1 = CallByName Num.22 List.173 List.174;
if List.634 then
let List.638 : [] = CallByName List.66 List.170 List.173;
let List.175 : List [] = CallByName List.279 List.171 List.638 List.172;
let List.637 : U64 = 1i64;
let List.636 : U64 = CallByName Num.51 List.173 List.637;
jump List.632 List.170 List.175 List.172 List.636 List.174;
procedure List.100 (#Derived_gen.0, #Derived_gen.1, #Derived_gen.2, #Derived_gen.3, #Derived_gen.4):
joinpoint List.665 List.174 List.175 List.176 List.177 List.178:
let List.667 : Int1 = CallByName Num.22 List.177 List.178;
if List.667 then
let List.671 : [] = CallByName List.66 List.174 List.177;
let List.179 : List [] = CallByName List.283 List.175 List.671 List.176;
let List.670 : U64 = 1i64;
let List.669 : U64 = CallByName Num.51 List.177 List.670;
jump List.665 List.174 List.179 List.176 List.669 List.178;
else
dec List.170;
ret List.171;
dec List.174;
ret List.175;
in
inc #Derived_gen.0;
jump List.632 #Derived_gen.0 #Derived_gen.1 #Derived_gen.2 #Derived_gen.3 #Derived_gen.4;
jump List.665 #Derived_gen.0 #Derived_gen.1 #Derived_gen.2 #Derived_gen.3 #Derived_gen.4;
procedure List.18 (List.171, List.172, List.173):
let List.663 : U64 = 0i64;
let List.664 : U64 = CallByName List.6 List.171;
let List.662 : List [] = CallByName List.100 List.171 List.172 List.173 List.663 List.664;
ret List.662;
procedure List.283 (List.284, List.285, List.281):
let List.676 : [] = CallByName Test.2 List.285;
let List.675 : List [] = CallByName List.71 List.284 List.676;
ret List.675;
procedure List.5 (List.280, List.281):
let List.282 : U64 = CallByName List.6 List.280;
let List.660 : List [] = CallByName List.68 List.282;
let List.659 : List [] = CallByName List.18 List.280 List.660 List.281;
ret List.659;
procedure List.6 (#Attr.2):
let List.673 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.673;
procedure List.66 (#Attr.2, #Attr.3):
let List.672 : [] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.672;
procedure List.68 (#Attr.2):
let List.678 : List [] = lowlevel ListWithCapacity #Attr.2;
ret List.678;
procedure List.71 (#Attr.2, #Attr.3):
let List.677 : List [] = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.677;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.282 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,32 +1,32 @@
procedure List.18 (List.167, List.168, List.169):
let List.627 : U64 = 0i64;
let List.628 : U64 = CallByName List.6 List.167;
let List.626 : [<r>C {}, C *self {{}, []}] = CallByName List.96 List.167 List.168 List.169 List.627 List.628;
ret List.626;
procedure List.6 (#Attr.2):
let List.637 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.637;
procedure List.66 (#Attr.2, #Attr.3):
let List.636 : [] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.636;
procedure List.96 (#Derived_gen.13, #Derived_gen.14, #Derived_gen.15, #Derived_gen.16, #Derived_gen.17):
joinpoint List.629 List.170 List.171 List.172 List.173 List.174:
let List.631 : Int1 = CallByName Num.22 List.173 List.174;
if List.631 then
let List.635 : [] = CallByName List.66 List.170 List.173;
let List.175 : [<r>C {}, C *self {{}, []}] = CallByName Test.29 List.171 List.635 List.172;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.51 List.173 List.634;
jump List.629 List.170 List.175 List.172 List.633 List.174;
procedure List.100 (#Derived_gen.13, #Derived_gen.14, #Derived_gen.15, #Derived_gen.16, #Derived_gen.17):
joinpoint List.662 List.174 List.175 List.176 List.177 List.178:
let List.664 : Int1 = CallByName Num.22 List.177 List.178;
if List.664 then
let List.668 : [] = CallByName List.66 List.174 List.177;
let List.179 : [<r>C {}, C *self {{}, []}] = CallByName Test.29 List.175 List.668 List.176;
let List.667 : U64 = 1i64;
let List.666 : U64 = CallByName Num.51 List.177 List.667;
jump List.662 List.174 List.179 List.176 List.666 List.178;
else
dec List.170;
ret List.171;
dec List.174;
ret List.175;
in
inc #Derived_gen.13;
jump List.629 #Derived_gen.13 #Derived_gen.14 #Derived_gen.15 #Derived_gen.16 #Derived_gen.17;
jump List.662 #Derived_gen.13 #Derived_gen.14 #Derived_gen.15 #Derived_gen.16 #Derived_gen.17;
procedure List.18 (List.171, List.172, List.173):
let List.660 : U64 = 0i64;
let List.661 : U64 = CallByName List.6 List.171;
let List.659 : [<r>C {}, C *self {{}, []}] = CallByName List.100 List.171 List.172 List.173 List.660 List.661;
ret List.659;
procedure List.6 (#Attr.2):
let List.670 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.670;
procedure List.66 (#Attr.2, #Attr.3):
let List.669 : [] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.669;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.282 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -2,92 +2,92 @@ procedure Bool.1 ():
let Bool.24 : Int1 = false;
ret Bool.24;
procedure List.18 (List.167, List.168, List.169):
let List.646 : U64 = 0i64;
let List.647 : U64 = CallByName List.6 List.167;
let List.645 : List Str = CallByName List.96 List.167 List.168 List.169 List.646 List.647;
ret List.645;
procedure List.100 (#Derived_gen.0, #Derived_gen.1, #Derived_gen.2, #Derived_gen.3, #Derived_gen.4):
joinpoint List.681 List.174 List.175 List.176 List.177 List.178:
let List.683 : Int1 = CallByName Num.22 List.177 List.178;
if List.683 then
let List.687 : [<r>C List [<r>C List *self, C *self], C [<r>C List *self, C *self]] = CallByName List.66 List.174 List.177;
inc List.687;
let List.179 : List Str = CallByName List.283 List.175 List.687 List.176;
let List.686 : U64 = 1i64;
let List.685 : U64 = CallByName Num.51 List.177 List.686;
jump List.681 List.174 List.179 List.176 List.685 List.178;
else
dec List.174;
ret List.175;
in
inc #Derived_gen.0;
jump List.681 #Derived_gen.0 #Derived_gen.1 #Derived_gen.2 #Derived_gen.3 #Derived_gen.4;
procedure List.2 (List.115, List.116):
let List.640 : U64 = CallByName List.6 List.115;
let List.636 : Int1 = CallByName Num.22 List.116 List.640;
if List.636 then
let List.638 : Str = CallByName List.66 List.115 List.116;
inc List.638;
let List.637 : [C {}, C Str] = TagId(1) List.638;
ret List.637;
procedure List.18 (List.171, List.172, List.173):
let List.679 : U64 = 0i64;
let List.680 : U64 = CallByName List.6 List.171;
let List.678 : List Str = CallByName List.100 List.171 List.172 List.173 List.679 List.680;
ret List.678;
procedure List.2 (List.119, List.120):
let List.673 : U64 = CallByName List.6 List.119;
let List.669 : Int1 = CallByName Num.22 List.120 List.673;
if List.669 then
let List.671 : Str = CallByName List.66 List.119 List.120;
inc List.671;
let List.670 : [C {}, C Str] = TagId(1) List.671;
ret List.670;
else
let List.635 : {} = Struct {};
let List.634 : [C {}, C Str] = TagId(0) List.635;
ret List.634;
let List.668 : {} = Struct {};
let List.667 : [C {}, C Str] = TagId(0) List.668;
ret List.667;
procedure List.279 (List.280, List.281, List.277):
let List.659 : Str = CallByName Test.10 List.281;
let List.658 : List Str = CallByName List.71 List.280 List.659;
ret List.658;
procedure List.283 (List.284, List.285, List.281):
let List.692 : Str = CallByName Test.10 List.285;
let List.691 : List Str = CallByName List.71 List.284 List.692;
ret List.691;
procedure List.5 (List.276, List.277):
let List.278 : U64 = CallByName List.6 List.276;
let List.643 : List Str = CallByName List.68 List.278;
let List.642 : List Str = CallByName List.18 List.276 List.643 List.277;
ret List.642;
procedure List.5 (List.280, List.281):
let List.282 : U64 = CallByName List.6 List.280;
let List.676 : List Str = CallByName List.68 List.282;
let List.675 : List Str = CallByName List.18 List.280 List.676 List.281;
ret List.675;
procedure List.6 (#Attr.2):
let List.641 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.641;
let List.674 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.674;
procedure List.6 (#Attr.2):
let List.656 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.656;
let List.689 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.689;
procedure List.66 (#Attr.2, #Attr.3):
let List.639 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.639;
let List.672 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.672;
procedure List.66 (#Attr.2, #Attr.3):
let List.655 : [<r>C List [<r>C List *self, C *self], C [<r>C List *self, C *self]] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.655;
let List.688 : [<r>C List [<r>C List *self, C *self], C [<r>C List *self, C *self]] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.688;
procedure List.68 (#Attr.2):
let List.661 : List Str = lowlevel ListWithCapacity #Attr.2;
ret List.661;
let List.694 : List Str = lowlevel ListWithCapacity #Attr.2;
ret List.694;
procedure List.71 (#Attr.2, #Attr.3):
let List.660 : List Str = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.660;
let List.693 : List Str = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.693;
procedure List.9 (List.387):
let List.633 : U64 = 0i64;
let List.626 : [C {}, C Str] = CallByName List.2 List.387 List.633;
let List.630 : U8 = 1i64;
let List.631 : U8 = GetTagId List.626;
let List.632 : Int1 = lowlevel Eq List.630 List.631;
if List.632 then
let List.388 : Str = UnionAtIndex (Id 1) (Index 0) List.626;
let List.627 : [C {}, C Str] = TagId(1) List.388;
ret List.627;
procedure List.9 (List.391):
let List.666 : U64 = 0i64;
let List.659 : [C {}, C Str] = CallByName List.2 List.391 List.666;
let List.663 : U8 = 1i64;
let List.664 : U8 = GetTagId List.659;
let List.665 : Int1 = lowlevel Eq List.663 List.664;
if List.665 then
let List.392 : Str = UnionAtIndex (Id 1) (Index 0) List.659;
let List.660 : [C {}, C Str] = TagId(1) List.392;
ret List.660;
else
dec List.626;
let List.629 : {} = Struct {};
let List.628 : [C {}, C Str] = TagId(0) List.629;
ret List.628;
procedure List.96 (#Derived_gen.3, #Derived_gen.4, #Derived_gen.5, #Derived_gen.6, #Derived_gen.7):
joinpoint List.648 List.170 List.171 List.172 List.173 List.174:
let List.650 : Int1 = CallByName Num.22 List.173 List.174;
if List.650 then
let List.654 : [<r>C List [<r>C List *self, C *self], C [<r>C List *self, C *self]] = CallByName List.66 List.170 List.173;
inc List.654;
let List.175 : List Str = CallByName List.279 List.171 List.654 List.172;
let List.653 : U64 = 1i64;
let List.652 : U64 = CallByName Num.51 List.173 List.653;
jump List.648 List.170 List.175 List.172 List.652 List.174;
else
dec List.170;
ret List.171;
in
inc #Derived_gen.3;
jump List.648 #Derived_gen.3 #Derived_gen.4 #Derived_gen.5 #Derived_gen.6 #Derived_gen.7;
dec List.659;
let List.662 : {} = Struct {};
let List.661 : [C {}, C Str] = TagId(0) List.662;
ret List.661;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.282 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
@ -97,17 +97,17 @@ procedure Num.51 (#Attr.2, #Attr.3):
let Num.283 : U64 = lowlevel NumAddWrap #Attr.2 #Attr.3;
ret Num.283;
procedure Result.5 (Result.13, Result.14):
let Result.57 : U8 = 1i64;
let Result.58 : U8 = GetTagId Result.13;
let Result.59 : Int1 = lowlevel Eq Result.57 Result.58;
if Result.59 then
dec Result.14;
let Result.15 : Str = UnionAtIndex (Id 1) (Index 0) Result.13;
ret Result.15;
procedure Result.5 (Result.14, Result.15):
let Result.63 : U8 = 1i64;
let Result.64 : U8 = GetTagId Result.14;
let Result.65 : Int1 = lowlevel Eq Result.63 Result.64;
if Result.65 then
dec Result.15;
let Result.16 : Str = UnionAtIndex (Id 1) (Index 0) Result.14;
ret Result.16;
else
dec Result.13;
ret Result.14;
dec Result.14;
ret Result.15;
procedure Test.10 (Test.11):
let Test.12 : Str = CallByName Test.2 Test.11;

View file

@ -1,6 +1,6 @@
procedure List.6 (#Attr.2):
let List.626 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.626;
let List.659 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.659;
procedure Test.1 (Test.5):
let Test.2 : I64 = 41i64;

View file

@ -2,35 +2,35 @@ procedure Bool.2 ():
let Bool.23 : Int1 = true;
ret Bool.23;
procedure List.18 (List.167, List.168, List.169):
let List.627 : U64 = 0i64;
let List.628 : U64 = CallByName List.6 List.167;
let List.626 : [<rnw><null>, C *self Int1, C *self Int1] = CallByName List.96 List.167 List.168 List.169 List.627 List.628;
ret List.626;
procedure List.100 (#Derived_gen.0, #Derived_gen.1, #Derived_gen.2, #Derived_gen.3, #Derived_gen.4):
joinpoint List.662 List.174 List.175 List.176 List.177 List.178:
let List.664 : Int1 = CallByName Num.22 List.177 List.178;
if List.664 then
let List.668 : Int1 = CallByName List.66 List.174 List.177;
let List.179 : [<rnw><null>, C *self Int1, C *self Int1] = CallByName Test.6 List.175 List.668 List.176;
let List.667 : U64 = 1i64;
let List.666 : U64 = CallByName Num.51 List.177 List.667;
jump List.662 List.174 List.179 List.176 List.666 List.178;
else
dec List.174;
ret List.175;
in
inc #Derived_gen.0;
jump List.662 #Derived_gen.0 #Derived_gen.1 #Derived_gen.2 #Derived_gen.3 #Derived_gen.4;
procedure List.18 (List.171, List.172, List.173):
let List.660 : U64 = 0i64;
let List.661 : U64 = CallByName List.6 List.171;
let List.659 : [<rnw><null>, C *self Int1, C *self Int1] = CallByName List.100 List.171 List.172 List.173 List.660 List.661;
ret List.659;
procedure List.6 (#Attr.2):
let List.637 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.637;
let List.670 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.670;
procedure List.66 (#Attr.2, #Attr.3):
let List.636 : Int1 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.636;
procedure List.96 (#Derived_gen.5, #Derived_gen.6, #Derived_gen.7, #Derived_gen.8, #Derived_gen.9):
joinpoint List.629 List.170 List.171 List.172 List.173 List.174:
let List.631 : Int1 = CallByName Num.22 List.173 List.174;
if List.631 then
let List.635 : Int1 = CallByName List.66 List.170 List.173;
let List.175 : [<rnw><null>, C *self Int1, C *self Int1] = CallByName Test.6 List.171 List.635 List.172;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.51 List.173 List.634;
jump List.629 List.170 List.175 List.172 List.633 List.174;
else
dec List.170;
ret List.171;
in
inc #Derived_gen.5;
jump List.629 #Derived_gen.5 #Derived_gen.6 #Derived_gen.7 #Derived_gen.8 #Derived_gen.9;
let List.669 : Int1 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.669;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.282 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
@ -47,7 +47,7 @@ procedure Str.3 (#Attr.2, #Attr.3):
procedure Test.1 (Test.5):
ret Test.5;
procedure Test.11 (#Derived_gen.3, #Derived_gen.4):
procedure Test.11 (#Derived_gen.8, #Derived_gen.9):
joinpoint Test.27 Test.12 #Attr.12:
let Test.34 : Int1 = UnionAtIndex (Id 2) (Index 1) #Attr.12;
let Test.33 : [<rnw><null>, C *self Int1, C *self Int1] = UnionAtIndex (Id 2) (Index 0) #Attr.12;
@ -87,7 +87,7 @@ procedure Test.11 (#Derived_gen.3, #Derived_gen.4):
decref #Attr.12;
jump #Derived_gen.12;
in
jump Test.27 #Derived_gen.3 #Derived_gen.4;
jump Test.27 #Derived_gen.8 #Derived_gen.9;
procedure Test.2 (Test.13):
ret Test.13;

View file

@ -26,8 +26,8 @@ procedure Dict.52 ():
ret Dict.743;
procedure List.6 (#Attr.2):
let List.626 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.626;
let List.659 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.659;
procedure Num.75 (#Attr.2, #Attr.3):
let Num.281 : U8 = lowlevel NumSubWrap #Attr.2 #Attr.3;

View file

@ -2,25 +2,25 @@ procedure Bool.1 ():
let Bool.23 : Int1 = false;
ret Bool.23;
procedure List.2 (List.115, List.116):
let List.632 : U64 = CallByName List.6 List.115;
let List.628 : Int1 = CallByName Num.22 List.116 List.632;
if List.628 then
let List.630 : {} = CallByName List.66 List.115 List.116;
let List.629 : [C {}, C {}] = TagId(1) List.630;
ret List.629;
procedure List.2 (List.119, List.120):
let List.665 : U64 = CallByName List.6 List.119;
let List.661 : Int1 = CallByName Num.22 List.120 List.665;
if List.661 then
let List.663 : {} = CallByName List.66 List.119 List.120;
let List.662 : [C {}, C {}] = TagId(1) List.663;
ret List.662;
else
let List.627 : {} = Struct {};
let List.626 : [C {}, C {}] = TagId(0) List.627;
ret List.626;
let List.660 : {} = Struct {};
let List.659 : [C {}, C {}] = TagId(0) List.660;
ret List.659;
procedure List.6 (#Attr.2):
let List.633 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.633;
let List.666 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.666;
procedure List.66 (#Attr.2, #Attr.3):
let List.631 : {} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.631;
let List.664 : {} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.664;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.281 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,16 +1,16 @@
procedure List.4 (List.131, List.132):
let List.629 : U64 = 1i64;
let List.627 : List U8 = CallByName List.70 List.131 List.629;
let List.626 : List U8 = CallByName List.71 List.627 List.132;
ret List.626;
procedure List.4 (List.135, List.136):
let List.662 : U64 = 1i64;
let List.660 : List U8 = CallByName List.70 List.135 List.662;
let List.659 : List U8 = CallByName List.71 List.660 List.136;
ret List.659;
procedure List.70 (#Attr.2, #Attr.3):
let List.630 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.630;
let List.663 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.663;
procedure List.71 (#Attr.2, #Attr.3):
let List.628 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.628;
let List.661 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.661;
procedure Test.23 (Test.24, Test.35, Test.22):
let Test.37 : List U8 = CallByName List.4 Test.24 Test.22;

View file

@ -67,85 +67,85 @@ procedure Encode.26 (Encode.107, Encode.108):
let Encode.110 : List U8 = CallByName Encode.24 Encode.111 Encode.112 Encode.108;
ret Encode.110;
procedure List.18 (List.167, List.168, List.169):
let List.627 : U64 = 0i64;
let List.628 : U64 = CallByName List.6 List.167;
let List.626 : List U8 = CallByName List.96 List.167 List.168 List.169 List.627 List.628;
ret List.626;
procedure List.18 (List.167, List.168, List.169):
let List.653 : U64 = 0i64;
let List.654 : U64 = CallByName List.6 List.167;
let List.652 : List U8 = CallByName List.96 List.167 List.168 List.169 List.653 List.654;
ret List.652;
procedure List.4 (List.131, List.132):
let List.674 : U64 = 1i64;
let List.673 : List U8 = CallByName List.70 List.131 List.674;
let List.672 : List U8 = CallByName List.71 List.673 List.132;
ret List.672;
procedure List.6 (#Attr.2):
let List.651 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.651;
procedure List.6 (#Attr.2):
let List.677 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.677;
procedure List.66 (#Attr.2, #Attr.3):
let List.636 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.636;
procedure List.66 (#Attr.2, #Attr.3):
let List.662 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.662;
procedure List.70 (#Attr.2, #Attr.3):
let List.668 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.668;
procedure List.71 (#Attr.2, #Attr.3):
let List.666 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.666;
procedure List.8 (#Attr.2, #Attr.3):
let List.676 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.676;
procedure List.96 (#Derived_gen.29, #Derived_gen.30, #Derived_gen.31, #Derived_gen.32, #Derived_gen.33):
joinpoint List.629 List.170 List.171 List.172 List.173 List.174:
let List.631 : Int1 = CallByName Num.22 List.173 List.174;
if List.631 then
let List.635 : {Str, Str} = CallByName List.66 List.170 List.173;
inc List.635;
let List.175 : List U8 = CallByName Test.71 List.171 List.635;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.51 List.173 List.634;
jump List.629 List.170 List.175 List.172 List.633 List.174;
procedure List.100 (#Derived_gen.29, #Derived_gen.30, #Derived_gen.31, #Derived_gen.32, #Derived_gen.33):
joinpoint List.688 List.174 List.175 List.176 List.177 List.178:
let List.690 : Int1 = CallByName Num.22 List.177 List.178;
if List.690 then
let List.694 : {Str, Str} = CallByName List.66 List.174 List.177;
inc List.694;
let List.179 : List U8 = CallByName Test.71 List.175 List.694;
let List.693 : U64 = 1i64;
let List.692 : U64 = CallByName Num.51 List.177 List.693;
jump List.688 List.174 List.179 List.176 List.692 List.178;
else
dec List.170;
ret List.171;
dec List.174;
ret List.175;
in
inc #Derived_gen.29;
jump List.629 #Derived_gen.29 #Derived_gen.30 #Derived_gen.31 #Derived_gen.32 #Derived_gen.33;
jump List.688 #Derived_gen.29 #Derived_gen.30 #Derived_gen.31 #Derived_gen.32 #Derived_gen.33;
procedure List.96 (#Derived_gen.34, #Derived_gen.35, #Derived_gen.36, #Derived_gen.37, #Derived_gen.38):
joinpoint List.655 List.170 List.171 List.172 List.173 List.174:
let List.657 : Int1 = CallByName Num.22 List.173 List.174;
if List.657 then
let List.661 : {Str, Str} = CallByName List.66 List.170 List.173;
inc List.661;
let List.175 : List U8 = CallByName Test.71 List.171 List.661;
let List.660 : U64 = 1i64;
let List.659 : U64 = CallByName Num.51 List.173 List.660;
jump List.655 List.170 List.175 List.172 List.659 List.174;
procedure List.100 (#Derived_gen.37, #Derived_gen.38, #Derived_gen.39, #Derived_gen.40, #Derived_gen.41):
joinpoint List.662 List.174 List.175 List.176 List.177 List.178:
let List.664 : Int1 = CallByName Num.22 List.177 List.178;
if List.664 then
let List.668 : {Str, Str} = CallByName List.66 List.174 List.177;
inc List.668;
let List.179 : List U8 = CallByName Test.71 List.175 List.668;
let List.667 : U64 = 1i64;
let List.666 : U64 = CallByName Num.51 List.177 List.667;
jump List.662 List.174 List.179 List.176 List.666 List.178;
else
dec List.170;
ret List.171;
dec List.174;
ret List.175;
in
inc #Derived_gen.34;
jump List.655 #Derived_gen.34 #Derived_gen.35 #Derived_gen.36 #Derived_gen.37 #Derived_gen.38;
inc #Derived_gen.37;
jump List.662 #Derived_gen.37 #Derived_gen.38 #Derived_gen.39 #Derived_gen.40 #Derived_gen.41;
procedure List.18 (List.171, List.172, List.173):
let List.660 : U64 = 0i64;
let List.661 : U64 = CallByName List.6 List.171;
let List.659 : List U8 = CallByName List.100 List.171 List.172 List.173 List.660 List.661;
ret List.659;
procedure List.18 (List.171, List.172, List.173):
let List.686 : U64 = 0i64;
let List.687 : U64 = CallByName List.6 List.171;
let List.685 : List U8 = CallByName List.100 List.171 List.172 List.173 List.686 List.687;
ret List.685;
procedure List.4 (List.135, List.136):
let List.707 : U64 = 1i64;
let List.706 : List U8 = CallByName List.70 List.135 List.707;
let List.705 : List U8 = CallByName List.71 List.706 List.136;
ret List.705;
procedure List.6 (#Attr.2):
let List.684 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.684;
procedure List.6 (#Attr.2):
let List.710 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.710;
procedure List.66 (#Attr.2, #Attr.3):
let List.669 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.669;
procedure List.66 (#Attr.2, #Attr.3):
let List.695 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.695;
procedure List.70 (#Attr.2, #Attr.3):
let List.701 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.701;
procedure List.71 (#Attr.2, #Attr.3):
let List.699 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.699;
procedure List.8 (#Attr.2, #Attr.3):
let List.709 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.709;
procedure Num.127 (#Attr.2):
let Num.286 : U8 = lowlevel NumIntCast #Attr.2;

View file

@ -39,54 +39,54 @@ procedure Encode.26 (Encode.107, Encode.108):
let Encode.110 : List U8 = CallByName Encode.24 Encode.111 Encode.112 Encode.108;
ret Encode.110;
procedure List.18 (List.167, List.168, List.169):
let List.627 : U64 = 0i64;
let List.628 : U64 = CallByName List.6 List.167;
let List.626 : List U8 = CallByName List.96 List.167 List.168 List.169 List.627 List.628;
ret List.626;
procedure List.4 (List.131, List.132):
let List.648 : U64 = 1i64;
let List.647 : List U8 = CallByName List.70 List.131 List.648;
let List.646 : List U8 = CallByName List.71 List.647 List.132;
ret List.646;
procedure List.6 (#Attr.2):
let List.651 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.651;
procedure List.66 (#Attr.2, #Attr.3):
let List.636 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.636;
procedure List.70 (#Attr.2, #Attr.3):
let List.642 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.642;
procedure List.71 (#Attr.2, #Attr.3):
let List.640 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.640;
procedure List.8 (#Attr.2, #Attr.3):
let List.650 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.650;
procedure List.96 (#Derived_gen.16, #Derived_gen.17, #Derived_gen.18, #Derived_gen.19, #Derived_gen.20):
joinpoint List.629 List.170 List.171 List.172 List.173 List.174:
let List.631 : Int1 = CallByName Num.22 List.173 List.174;
if List.631 then
let List.635 : {Str, Str} = CallByName List.66 List.170 List.173;
inc List.635;
let List.175 : List U8 = CallByName Test.71 List.171 List.635;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.51 List.173 List.634;
jump List.629 List.170 List.175 List.172 List.633 List.174;
procedure List.100 (#Derived_gen.16, #Derived_gen.17, #Derived_gen.18, #Derived_gen.19, #Derived_gen.20):
joinpoint List.662 List.174 List.175 List.176 List.177 List.178:
let List.664 : Int1 = CallByName Num.22 List.177 List.178;
if List.664 then
let List.668 : {Str, Str} = CallByName List.66 List.174 List.177;
inc List.668;
let List.179 : List U8 = CallByName Test.71 List.175 List.668;
let List.667 : U64 = 1i64;
let List.666 : U64 = CallByName Num.51 List.177 List.667;
jump List.662 List.174 List.179 List.176 List.666 List.178;
else
dec List.170;
ret List.171;
dec List.174;
ret List.175;
in
inc #Derived_gen.16;
jump List.629 #Derived_gen.16 #Derived_gen.17 #Derived_gen.18 #Derived_gen.19 #Derived_gen.20;
jump List.662 #Derived_gen.16 #Derived_gen.17 #Derived_gen.18 #Derived_gen.19 #Derived_gen.20;
procedure List.18 (List.171, List.172, List.173):
let List.660 : U64 = 0i64;
let List.661 : U64 = CallByName List.6 List.171;
let List.659 : List U8 = CallByName List.100 List.171 List.172 List.173 List.660 List.661;
ret List.659;
procedure List.4 (List.135, List.136):
let List.681 : U64 = 1i64;
let List.680 : List U8 = CallByName List.70 List.135 List.681;
let List.679 : List U8 = CallByName List.71 List.680 List.136;
ret List.679;
procedure List.6 (#Attr.2):
let List.684 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.684;
procedure List.66 (#Attr.2, #Attr.3):
let List.669 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.669;
procedure List.70 (#Attr.2, #Attr.3):
let List.675 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.675;
procedure List.71 (#Attr.2, #Attr.3):
let List.673 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.673;
procedure List.8 (#Attr.2, #Attr.3):
let List.683 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.683;
procedure Num.127 (#Attr.2):
let Num.282 : U8 = lowlevel NumIntCast #Attr.2;

View file

@ -46,54 +46,54 @@ procedure Encode.26 (Encode.107, Encode.108):
let Encode.110 : List U8 = CallByName Encode.24 Encode.111 Encode.112 Encode.108;
ret Encode.110;
procedure List.18 (List.167, List.168, List.169):
let List.627 : U64 = 0i64;
let List.628 : U64 = CallByName List.6 List.167;
let List.626 : List U8 = CallByName List.96 List.167 List.168 List.169 List.627 List.628;
ret List.626;
procedure List.4 (List.131, List.132):
let List.648 : U64 = 1i64;
let List.647 : List U8 = CallByName List.70 List.131 List.648;
let List.646 : List U8 = CallByName List.71 List.647 List.132;
ret List.646;
procedure List.6 (#Attr.2):
let List.651 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.651;
procedure List.66 (#Attr.2, #Attr.3):
let List.636 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.636;
procedure List.70 (#Attr.2, #Attr.3):
let List.642 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.642;
procedure List.71 (#Attr.2, #Attr.3):
let List.640 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.640;
procedure List.8 (#Attr.2, #Attr.3):
let List.650 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.650;
procedure List.96 (#Derived_gen.20, #Derived_gen.21, #Derived_gen.22, #Derived_gen.23, #Derived_gen.24):
joinpoint List.629 List.170 List.171 List.172 List.173 List.174:
let List.631 : Int1 = CallByName Num.22 List.173 List.174;
if List.631 then
let List.635 : {Str, Str} = CallByName List.66 List.170 List.173;
inc List.635;
let List.175 : List U8 = CallByName Test.71 List.171 List.635;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.51 List.173 List.634;
jump List.629 List.170 List.175 List.172 List.633 List.174;
procedure List.100 (#Derived_gen.20, #Derived_gen.21, #Derived_gen.22, #Derived_gen.23, #Derived_gen.24):
joinpoint List.662 List.174 List.175 List.176 List.177 List.178:
let List.664 : Int1 = CallByName Num.22 List.177 List.178;
if List.664 then
let List.668 : {Str, Str} = CallByName List.66 List.174 List.177;
inc List.668;
let List.179 : List U8 = CallByName Test.71 List.175 List.668;
let List.667 : U64 = 1i64;
let List.666 : U64 = CallByName Num.51 List.177 List.667;
jump List.662 List.174 List.179 List.176 List.666 List.178;
else
dec List.170;
ret List.171;
dec List.174;
ret List.175;
in
inc #Derived_gen.20;
jump List.629 #Derived_gen.20 #Derived_gen.21 #Derived_gen.22 #Derived_gen.23 #Derived_gen.24;
jump List.662 #Derived_gen.20 #Derived_gen.21 #Derived_gen.22 #Derived_gen.23 #Derived_gen.24;
procedure List.18 (List.171, List.172, List.173):
let List.660 : U64 = 0i64;
let List.661 : U64 = CallByName List.6 List.171;
let List.659 : List U8 = CallByName List.100 List.171 List.172 List.173 List.660 List.661;
ret List.659;
procedure List.4 (List.135, List.136):
let List.681 : U64 = 1i64;
let List.680 : List U8 = CallByName List.70 List.135 List.681;
let List.679 : List U8 = CallByName List.71 List.680 List.136;
ret List.679;
procedure List.6 (#Attr.2):
let List.684 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.684;
procedure List.66 (#Attr.2, #Attr.3):
let List.669 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.669;
procedure List.70 (#Attr.2, #Attr.3):
let List.675 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.675;
procedure List.71 (#Attr.2, #Attr.3):
let List.673 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.673;
procedure List.8 (#Attr.2, #Attr.3):
let List.683 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.683;
procedure Num.127 (#Attr.2):
let Num.282 : U8 = lowlevel NumIntCast #Attr.2;

View file

@ -11,23 +11,23 @@ procedure Encode.26 (Encode.107, Encode.108):
let Encode.110 : List U8 = CallByName Encode.24 Encode.111 Encode.112 Encode.108;
ret Encode.110;
procedure List.4 (List.131, List.132):
let List.636 : U64 = 1i64;
let List.635 : List U8 = CallByName List.70 List.131 List.636;
let List.634 : List U8 = CallByName List.71 List.635 List.132;
ret List.634;
procedure List.4 (List.135, List.136):
let List.669 : U64 = 1i64;
let List.668 : List U8 = CallByName List.70 List.135 List.669;
let List.667 : List U8 = CallByName List.71 List.668 List.136;
ret List.667;
procedure List.70 (#Attr.2, #Attr.3):
let List.630 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.630;
let List.663 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.663;
procedure List.71 (#Attr.2, #Attr.3):
let List.628 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.628;
let List.661 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.661;
procedure List.8 (#Attr.2, #Attr.3):
let List.638 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.638;
let List.671 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.671;
procedure Num.127 (#Attr.2):
let Num.282 : U8 = lowlevel NumIntCast #Attr.2;

View file

@ -40,58 +40,58 @@ procedure Encode.26 (Encode.107, Encode.108):
let Encode.110 : List U8 = CallByName Encode.24 Encode.111 Encode.112 Encode.108;
ret Encode.110;
procedure List.100 (#Derived_gen.22, #Derived_gen.23, #Derived_gen.24, #Derived_gen.25, #Derived_gen.26):
joinpoint List.662 List.174 List.175 List.176 List.177 List.178:
let List.664 : Int1 = CallByName Num.22 List.177 List.178;
if List.664 then
let List.668 : Str = CallByName List.66 List.174 List.177;
inc List.668;
let List.179 : List U8 = CallByName Test.64 List.175 List.668 List.176;
let List.667 : U64 = 1i64;
let List.666 : U64 = CallByName Num.51 List.177 List.667;
jump List.662 List.174 List.179 List.176 List.666 List.178;
else
dec List.174;
ret List.175;
in
inc #Derived_gen.22;
jump List.662 #Derived_gen.22 #Derived_gen.23 #Derived_gen.24 #Derived_gen.25 #Derived_gen.26;
procedure List.13 (#Attr.2, #Attr.3):
let List.652 : List Str = lowlevel ListPrepend #Attr.2 #Attr.3;
ret List.652;
let List.685 : List Str = lowlevel ListPrepend #Attr.2 #Attr.3;
ret List.685;
procedure List.18 (List.167, List.168, List.169):
let List.627 : U64 = 0i64;
let List.628 : U64 = CallByName List.6 List.167;
let List.626 : List U8 = CallByName List.96 List.167 List.168 List.169 List.627 List.628;
ret List.626;
procedure List.18 (List.171, List.172, List.173):
let List.660 : U64 = 0i64;
let List.661 : U64 = CallByName List.6 List.171;
let List.659 : List U8 = CallByName List.100 List.171 List.172 List.173 List.660 List.661;
ret List.659;
procedure List.4 (List.131, List.132):
let List.648 : U64 = 1i64;
let List.647 : List U8 = CallByName List.70 List.131 List.648;
let List.646 : List U8 = CallByName List.71 List.647 List.132;
ret List.646;
procedure List.4 (List.135, List.136):
let List.681 : U64 = 1i64;
let List.680 : List U8 = CallByName List.70 List.135 List.681;
let List.679 : List U8 = CallByName List.71 List.680 List.136;
ret List.679;
procedure List.6 (#Attr.2):
let List.651 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.651;
let List.684 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.684;
procedure List.66 (#Attr.2, #Attr.3):
let List.636 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.636;
let List.669 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.669;
procedure List.70 (#Attr.2, #Attr.3):
let List.642 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.642;
let List.675 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.675;
procedure List.71 (#Attr.2, #Attr.3):
let List.640 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.640;
let List.673 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.673;
procedure List.8 (#Attr.2, #Attr.3):
let List.650 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.650;
procedure List.96 (#Derived_gen.13, #Derived_gen.14, #Derived_gen.15, #Derived_gen.16, #Derived_gen.17):
joinpoint List.629 List.170 List.171 List.172 List.173 List.174:
let List.631 : Int1 = CallByName Num.22 List.173 List.174;
if List.631 then
let List.635 : Str = CallByName List.66 List.170 List.173;
inc List.635;
let List.175 : List U8 = CallByName Test.64 List.171 List.635 List.172;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.51 List.173 List.634;
jump List.629 List.170 List.175 List.172 List.633 List.174;
else
dec List.170;
ret List.171;
in
inc #Derived_gen.13;
jump List.629 #Derived_gen.13 #Derived_gen.14 #Derived_gen.15 #Derived_gen.16 #Derived_gen.17;
let List.683 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.683;
procedure Num.127 (#Attr.2):
let Num.282 : U8 = lowlevel NumIntCast #Attr.2;

View file

@ -43,58 +43,58 @@ procedure Encode.26 (Encode.107, Encode.108):
let Encode.110 : List U8 = CallByName Encode.24 Encode.111 Encode.112 Encode.108;
ret Encode.110;
procedure List.13 (#Attr.2, #Attr.3):
let List.652 : List Str = lowlevel ListPrepend #Attr.2 #Attr.3;
ret List.652;
procedure List.18 (List.167, List.168, List.169):
let List.627 : U64 = 0i64;
let List.628 : U64 = CallByName List.6 List.167;
let List.626 : List U8 = CallByName List.96 List.167 List.168 List.169 List.627 List.628;
ret List.626;
procedure List.4 (List.131, List.132):
let List.648 : U64 = 1i64;
let List.647 : List U8 = CallByName List.70 List.131 List.648;
let List.646 : List U8 = CallByName List.71 List.647 List.132;
ret List.646;
procedure List.6 (#Attr.2):
let List.651 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.651;
procedure List.66 (#Attr.2, #Attr.3):
let List.636 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.636;
procedure List.70 (#Attr.2, #Attr.3):
let List.642 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.642;
procedure List.71 (#Attr.2, #Attr.3):
let List.640 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.640;
procedure List.8 (#Attr.2, #Attr.3):
let List.650 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.650;
procedure List.96 (#Derived_gen.23, #Derived_gen.24, #Derived_gen.25, #Derived_gen.26, #Derived_gen.27):
joinpoint List.629 List.170 List.171 List.172 List.173 List.174:
let List.631 : Int1 = CallByName Num.22 List.173 List.174;
if List.631 then
let List.635 : Str = CallByName List.66 List.170 List.173;
inc List.635;
let List.175 : List U8 = CallByName Test.64 List.171 List.635 List.172;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.51 List.173 List.634;
jump List.629 List.170 List.175 List.172 List.633 List.174;
procedure List.100 (#Derived_gen.23, #Derived_gen.24, #Derived_gen.25, #Derived_gen.26, #Derived_gen.27):
joinpoint List.662 List.174 List.175 List.176 List.177 List.178:
let List.664 : Int1 = CallByName Num.22 List.177 List.178;
if List.664 then
let List.668 : Str = CallByName List.66 List.174 List.177;
inc List.668;
let List.179 : List U8 = CallByName Test.64 List.175 List.668 List.176;
let List.667 : U64 = 1i64;
let List.666 : U64 = CallByName Num.51 List.177 List.667;
jump List.662 List.174 List.179 List.176 List.666 List.178;
else
dec List.170;
ret List.171;
dec List.174;
ret List.175;
in
inc #Derived_gen.23;
jump List.629 #Derived_gen.23 #Derived_gen.24 #Derived_gen.25 #Derived_gen.26 #Derived_gen.27;
jump List.662 #Derived_gen.23 #Derived_gen.24 #Derived_gen.25 #Derived_gen.26 #Derived_gen.27;
procedure List.13 (#Attr.2, #Attr.3):
let List.685 : List Str = lowlevel ListPrepend #Attr.2 #Attr.3;
ret List.685;
procedure List.18 (List.171, List.172, List.173):
let List.660 : U64 = 0i64;
let List.661 : U64 = CallByName List.6 List.171;
let List.659 : List U8 = CallByName List.100 List.171 List.172 List.173 List.660 List.661;
ret List.659;
procedure List.4 (List.135, List.136):
let List.681 : U64 = 1i64;
let List.680 : List U8 = CallByName List.70 List.135 List.681;
let List.679 : List U8 = CallByName List.71 List.680 List.136;
ret List.679;
procedure List.6 (#Attr.2):
let List.684 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.684;
procedure List.66 (#Attr.2, #Attr.3):
let List.669 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.669;
procedure List.70 (#Attr.2, #Attr.3):
let List.675 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.675;
procedure List.71 (#Attr.2, #Attr.3):
let List.673 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.673;
procedure List.8 (#Attr.2, #Attr.3):
let List.683 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.683;
procedure Num.127 (#Attr.2):
let Num.282 : U8 = lowlevel NumIntCast #Attr.2;

View file

@ -145,7 +145,7 @@ procedure Dict.43 (Dict.126):
let Dict.1101 : {List {U32, U32}, List {Str, I64}, U64, Float32, U8} = CallByName Inspect.30 Dict.126;
ret Dict.1101;
procedure Dict.45 (#Derived_gen.42, #Derived_gen.43, #Derived_gen.44, #Derived_gen.45, #Derived_gen.46, #Derived_gen.47, #Derived_gen.48, #Derived_gen.49, #Derived_gen.50):
procedure Dict.45 (#Derived_gen.45, #Derived_gen.46, #Derived_gen.47, #Derived_gen.48, #Derived_gen.49, #Derived_gen.50, #Derived_gen.51, #Derived_gen.52, #Derived_gen.53):
joinpoint Dict.744 Dict.228 Dict.229 Dict.230 Dict.231 Dict.232 Dict.233 Dict.234 Dict.235 Dict.236:
let Dict.237 : {U32, U32} = CallByName Dict.22 Dict.228 Dict.230;
let Dict.791 : U32 = StructAtIndex 1 Dict.237;
@ -188,8 +188,8 @@ procedure Dict.45 (#Derived_gen.42, #Derived_gen.43, #Derived_gen.44, #Derived_g
let Dict.246 : U32 = CallByName Dict.55 Dict.231;
jump Dict.744 Dict.228 Dict.229 Dict.245 Dict.246 Dict.232 Dict.233 Dict.234 Dict.235 Dict.236;
in
inc #Derived_gen.46;
jump Dict.744 #Derived_gen.42 #Derived_gen.43 #Derived_gen.44 #Derived_gen.45 #Derived_gen.46 #Derived_gen.47 #Derived_gen.48 #Derived_gen.49 #Derived_gen.50;
inc #Derived_gen.49;
jump Dict.744 #Derived_gen.45 #Derived_gen.46 #Derived_gen.47 #Derived_gen.48 #Derived_gen.49 #Derived_gen.50 #Derived_gen.51 #Derived_gen.52 #Derived_gen.53;
procedure Dict.48 ():
let Dict.868 : U32 = 0i64;
@ -304,7 +304,7 @@ procedure Dict.72 (Dict.412, Dict.413, Dict.414):
let Dict.854 : {U64, U32} = CallByName Dict.73 Dict.412 Dict.417 Dict.416;
ret Dict.854;
procedure Dict.73 (#Derived_gen.21, #Derived_gen.22, #Derived_gen.23):
procedure Dict.73 (#Derived_gen.16, #Derived_gen.17, #Derived_gen.18):
joinpoint Dict.855 Dict.418 Dict.419 Dict.420:
let Dict.421 : {U32, U32} = CallByName Dict.22 Dict.418 Dict.419;
let Dict.862 : U32 = StructAtIndex 1 Dict.421;
@ -319,10 +319,10 @@ procedure Dict.73 (#Derived_gen.21, #Derived_gen.22, #Derived_gen.23):
let Dict.856 : {U64, U32} = Struct {Dict.419, Dict.420};
ret Dict.856;
in
inc #Derived_gen.21;
jump Dict.855 #Derived_gen.21 #Derived_gen.22 #Derived_gen.23;
inc #Derived_gen.16;
jump Dict.855 #Derived_gen.16 #Derived_gen.17 #Derived_gen.18;
procedure Dict.74 (#Derived_gen.51, #Derived_gen.52, #Derived_gen.53):
procedure Dict.74 (#Derived_gen.54, #Derived_gen.55, #Derived_gen.56):
joinpoint Dict.761 Dict.422 Dict.423 Dict.424:
let Dict.425 : {U32, U32} = CallByName Dict.22 Dict.422 Dict.424;
let Dict.771 : U32 = StructAtIndex 1 Dict.425;
@ -341,7 +341,7 @@ procedure Dict.74 (#Derived_gen.51, #Derived_gen.52, #Derived_gen.53):
let Dict.762 : List {U32, U32} = CallByName List.3 Dict.422 Dict.424 Dict.423;
ret Dict.762;
in
jump Dict.761 #Derived_gen.51 #Derived_gen.52 #Derived_gen.53;
jump Dict.761 #Derived_gen.54 #Derived_gen.55 #Derived_gen.56;
procedure Dict.75 (Dict.427, Dict.428):
let Dict.757 : U64 = 1i64;
@ -890,171 +890,171 @@ procedure Inspect.63 (Inspect.300, Inspect.296):
procedure Inspect.64 (Inspect.302):
ret Inspect.302;
procedure List.11 (List.145, List.146):
let List.688 : List {U32, U32} = CallByName List.68 List.146;
let List.687 : List {U32, U32} = CallByName List.94 List.145 List.146 List.688;
ret List.687;
procedure List.100 (#Derived_gen.40, #Derived_gen.41, #Derived_gen.42, #Derived_gen.43, #Derived_gen.44):
joinpoint List.726 List.174 List.175 List.176 List.177 List.178:
let List.728 : Int1 = CallByName Num.22 List.177 List.178;
if List.728 then
let List.732 : {Str, I64} = CallByName List.66 List.174 List.177;
inc List.732;
let List.179 : {Str, Int1} = CallByName Dict.188 List.175 List.732 List.176;
let List.731 : U64 = 1i64;
let List.730 : U64 = CallByName Num.51 List.177 List.731;
jump List.726 List.174 List.179 List.176 List.730 List.178;
else
dec List.174;
ret List.175;
in
inc #Derived_gen.40;
jump List.726 #Derived_gen.40 #Derived_gen.41 #Derived_gen.42 #Derived_gen.43 #Derived_gen.44;
procedure List.18 (List.167, List.168, List.169):
let List.627 : U64 = 0i64;
let List.628 : U64 = CallByName List.6 List.167;
let List.626 : {List {U32, U32}, List {Str, I64}, U64, Float32, U8} = CallByName List.96 List.167 List.168 List.169 List.627 List.628;
ret List.626;
procedure List.100 (#Derived_gen.61, #Derived_gen.62, #Derived_gen.63, #Derived_gen.64, #Derived_gen.65):
joinpoint List.662 List.174 List.175 List.176 List.177 List.178:
let List.664 : Int1 = CallByName Num.22 List.177 List.178;
if List.664 then
let List.668 : {Str, I64} = CallByName List.66 List.174 List.177;
inc List.668;
let List.179 : {List {U32, U32}, List {Str, I64}, U64, Float32, U8} = CallByName Dict.159 List.175 List.668;
let List.667 : U64 = 1i64;
let List.666 : U64 = CallByName Num.51 List.177 List.667;
jump List.662 List.174 List.179 List.176 List.666 List.178;
else
dec List.174;
ret List.175;
in
inc #Derived_gen.61;
jump List.662 #Derived_gen.61 #Derived_gen.62 #Derived_gen.63 #Derived_gen.64 #Derived_gen.65;
procedure List.18 (List.167, List.168, List.169):
let List.691 : U64 = 0i64;
let List.692 : U64 = CallByName List.6 List.167;
let List.690 : {Str, Int1} = CallByName List.96 List.167 List.168 List.169 List.691 List.692;
ret List.690;
procedure List.101 (#Derived_gen.21, #Derived_gen.22, #Derived_gen.23, #Derived_gen.24, #Derived_gen.25):
joinpoint List.701 List.183 List.184 List.185 List.186 List.187:
let List.703 : Int1 = CallByName Num.22 List.186 List.187;
if List.703 then
let List.707 : {Str, I64} = CallByName List.66 List.183 List.186;
inc List.707;
let List.188 : List {U32, U32} = CallByName Dict.406 List.184 List.707 List.186 List.185;
let List.706 : U64 = 1i64;
let List.705 : U64 = CallByName Num.51 List.186 List.706;
jump List.701 List.183 List.188 List.185 List.705 List.187;
else
dec List.183;
ret List.184;
in
inc #Derived_gen.21;
jump List.701 #Derived_gen.21 #Derived_gen.22 #Derived_gen.23 #Derived_gen.24 #Derived_gen.25;
procedure List.3 (List.123, List.124, List.125):
let List.652 : {List {U32, U32}, {U32, U32}} = CallByName List.64 List.123 List.124 List.125;
let List.651 : List {U32, U32} = StructAtIndex 0 List.652;
ret List.651;
procedure List.11 (List.149, List.150):
let List.721 : List {U32, U32} = CallByName List.68 List.150;
let List.720 : List {U32, U32} = CallByName List.98 List.149 List.150 List.721;
ret List.720;
procedure List.3 (List.123, List.124, List.125):
let List.654 : {List {Str, I64}, {Str, I64}} = CallByName List.64 List.123 List.124 List.125;
let List.653 : List {Str, I64} = StructAtIndex 0 List.654;
let #Derived_gen.71 : {Str, I64} = StructAtIndex 1 List.654;
procedure List.18 (List.171, List.172, List.173):
let List.660 : U64 = 0i64;
let List.661 : U64 = CallByName List.6 List.171;
let List.659 : {List {U32, U32}, List {Str, I64}, U64, Float32, U8} = CallByName List.100 List.171 List.172 List.173 List.660 List.661;
ret List.659;
procedure List.18 (List.171, List.172, List.173):
let List.724 : U64 = 0i64;
let List.725 : U64 = CallByName List.6 List.171;
let List.723 : {Str, Int1} = CallByName List.100 List.171 List.172 List.173 List.724 List.725;
ret List.723;
procedure List.3 (List.127, List.128, List.129):
let List.685 : {List {U32, U32}, {U32, U32}} = CallByName List.64 List.127 List.128 List.129;
let List.684 : List {U32, U32} = StructAtIndex 0 List.685;
ret List.684;
procedure List.3 (List.127, List.128, List.129):
let List.687 : {List {Str, I64}, {Str, I64}} = CallByName List.64 List.127 List.128 List.129;
let List.686 : List {Str, I64} = StructAtIndex 0 List.687;
let #Derived_gen.71 : {Str, I64} = StructAtIndex 1 List.687;
dec #Derived_gen.71;
ret List.653;
procedure List.4 (List.131, List.132):
let List.663 : U64 = 1i64;
let List.661 : List {Str, I64} = CallByName List.70 List.131 List.663;
let List.660 : List {Str, I64} = CallByName List.71 List.661 List.132;
ret List.660;
procedure List.6 (#Attr.2):
let List.642 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.642;
procedure List.6 (#Attr.2):
let List.689 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.689;
procedure List.6 (#Attr.2):
let List.701 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.701;
procedure List.64 (List.120, List.121, List.122):
let List.650 : U64 = CallByName List.6 List.120;
let List.647 : Int1 = CallByName Num.22 List.121 List.650;
if List.647 then
let List.648 : {List {U32, U32}, {U32, U32}} = CallByName List.67 List.120 List.121 List.122;
ret List.648;
else
let List.646 : {List {U32, U32}, {U32, U32}} = Struct {List.120, List.122};
ret List.646;
procedure List.64 (List.120, List.121, List.122):
let List.659 : U64 = CallByName List.6 List.120;
let List.656 : Int1 = CallByName Num.22 List.121 List.659;
if List.656 then
let List.657 : {List {Str, I64}, {Str, I64}} = CallByName List.67 List.120 List.121 List.122;
ret List.657;
else
let List.655 : {List {Str, I64}, {Str, I64}} = Struct {List.120, List.122};
ret List.655;
procedure List.66 (#Attr.2, #Attr.3):
let List.700 : {Str, I64} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.700;
procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
let List.649 : {List {U32, U32}, {U32, U32}} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.649;
procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
let List.658 : {List {Str, I64}, {Str, I64}} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.658;
procedure List.68 (#Attr.2):
let List.686 : List {U32, U32} = lowlevel ListWithCapacity #Attr.2;
ret List.686;
procedure List.4 (List.135, List.136):
let List.696 : U64 = 1i64;
let List.694 : List {Str, I64} = CallByName List.70 List.135 List.696;
let List.693 : List {Str, I64} = CallByName List.71 List.694 List.136;
ret List.693;
procedure List.6 (#Attr.2):
let List.675 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.675;
procedure List.6 (#Attr.2):
let List.722 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.722;
procedure List.6 (#Attr.2):
let List.734 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.734;
procedure List.64 (List.124, List.125, List.126):
let List.683 : U64 = CallByName List.6 List.124;
let List.680 : Int1 = CallByName Num.22 List.125 List.683;
if List.680 then
let List.681 : {List {U32, U32}, {U32, U32}} = CallByName List.67 List.124 List.125 List.126;
ret List.681;
else
let List.679 : {List {U32, U32}, {U32, U32}} = Struct {List.124, List.126};
ret List.679;
procedure List.64 (List.124, List.125, List.126):
let List.692 : U64 = CallByName List.6 List.124;
let List.689 : Int1 = CallByName Num.22 List.125 List.692;
if List.689 then
let List.690 : {List {Str, I64}, {Str, I64}} = CallByName List.67 List.124 List.125 List.126;
ret List.690;
else
let List.688 : {List {Str, I64}, {Str, I64}} = Struct {List.124, List.126};
ret List.688;
procedure List.66 (#Attr.2, #Attr.3):
let List.733 : {Str, I64} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.733;
procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
let List.682 : {List {U32, U32}, {U32, U32}} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.682;
procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
let List.691 : {List {Str, I64}, {Str, I64}} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.691;
procedure List.68 (#Attr.2):
let List.719 : List {U32, U32} = lowlevel ListWithCapacity #Attr.2;
ret List.719;
procedure List.70 (#Attr.2, #Attr.3):
let List.664 : List {Str, I64} = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.664;
let List.697 : List {Str, I64} = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.697;
procedure List.71 (#Attr.2, #Attr.3):
let List.662 : List {Str, I64} = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.662;
let List.695 : List {Str, I64} = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.695;
procedure List.71 (#Attr.2, #Attr.3):
let List.683 : List {U32, U32} = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.683;
let List.716 : List {U32, U32} = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.716;
procedure List.83 (List.176, List.177, List.178):
let List.666 : U64 = 0i64;
let List.667 : U64 = CallByName List.6 List.176;
let List.665 : List {U32, U32} = CallByName List.97 List.176 List.177 List.178 List.666 List.667;
ret List.665;
procedure List.83 (List.180, List.181, List.182):
let List.699 : U64 = 0i64;
let List.700 : U64 = CallByName List.6 List.180;
let List.698 : List {U32, U32} = CallByName List.101 List.180 List.181 List.182 List.699 List.700;
ret List.698;
procedure List.94 (#Derived_gen.54, #Derived_gen.55, #Derived_gen.56):
joinpoint List.677 List.147 List.148 List.149:
let List.685 : U64 = 0i64;
let List.679 : Int1 = CallByName Num.24 List.148 List.685;
if List.679 then
let List.684 : U64 = 1i64;
let List.681 : U64 = CallByName Num.75 List.148 List.684;
let List.682 : List {U32, U32} = CallByName List.71 List.149 List.147;
jump List.677 List.147 List.681 List.682;
procedure List.98 (#Derived_gen.28, #Derived_gen.29, #Derived_gen.30):
joinpoint List.710 List.151 List.152 List.153:
let List.718 : U64 = 0i64;
let List.712 : Int1 = CallByName Num.24 List.152 List.718;
if List.712 then
let List.717 : U64 = 1i64;
let List.714 : U64 = CallByName Num.75 List.152 List.717;
let List.715 : List {U32, U32} = CallByName List.71 List.153 List.151;
jump List.710 List.151 List.714 List.715;
else
ret List.149;
ret List.153;
in
jump List.677 #Derived_gen.54 #Derived_gen.55 #Derived_gen.56;
procedure List.96 (#Derived_gen.12, #Derived_gen.13, #Derived_gen.14, #Derived_gen.15, #Derived_gen.16):
joinpoint List.693 List.170 List.171 List.172 List.173 List.174:
let List.695 : Int1 = CallByName Num.22 List.173 List.174;
if List.695 then
let List.699 : {Str, I64} = CallByName List.66 List.170 List.173;
inc List.699;
let List.175 : {Str, Int1} = CallByName Dict.188 List.171 List.699 List.172;
let List.698 : U64 = 1i64;
let List.697 : U64 = CallByName Num.51 List.173 List.698;
jump List.693 List.170 List.175 List.172 List.697 List.174;
else
dec List.170;
ret List.171;
in
inc #Derived_gen.12;
jump List.693 #Derived_gen.12 #Derived_gen.13 #Derived_gen.14 #Derived_gen.15 #Derived_gen.16;
procedure List.96 (#Derived_gen.59, #Derived_gen.60, #Derived_gen.61, #Derived_gen.62, #Derived_gen.63):
joinpoint List.629 List.170 List.171 List.172 List.173 List.174:
let List.631 : Int1 = CallByName Num.22 List.173 List.174;
if List.631 then
let List.635 : {Str, I64} = CallByName List.66 List.170 List.173;
inc List.635;
let List.175 : {List {U32, U32}, List {Str, I64}, U64, Float32, U8} = CallByName Dict.159 List.171 List.635;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.51 List.173 List.634;
jump List.629 List.170 List.175 List.172 List.633 List.174;
else
dec List.170;
ret List.171;
in
inc #Derived_gen.59;
jump List.629 #Derived_gen.59 #Derived_gen.60 #Derived_gen.61 #Derived_gen.62 #Derived_gen.63;
procedure List.97 (#Derived_gen.31, #Derived_gen.32, #Derived_gen.33, #Derived_gen.34, #Derived_gen.35):
joinpoint List.668 List.179 List.180 List.181 List.182 List.183:
let List.670 : Int1 = CallByName Num.22 List.182 List.183;
if List.670 then
let List.674 : {Str, I64} = CallByName List.66 List.179 List.182;
inc List.674;
let List.184 : List {U32, U32} = CallByName Dict.406 List.180 List.674 List.182 List.181;
let List.673 : U64 = 1i64;
let List.672 : U64 = CallByName Num.51 List.182 List.673;
jump List.668 List.179 List.184 List.181 List.672 List.183;
else
dec List.179;
ret List.180;
in
inc #Derived_gen.31;
jump List.668 #Derived_gen.31 #Derived_gen.32 #Derived_gen.33 #Derived_gen.34 #Derived_gen.35;
jump List.710 #Derived_gen.28 #Derived_gen.29 #Derived_gen.30;
procedure Num.131 (#Attr.2):
let Num.289 : U32 = lowlevel NumIntCast #Attr.2;

View file

@ -135,35 +135,35 @@ procedure Inspect.63 (Inspect.300, Inspect.296):
procedure Inspect.64 (Inspect.302):
ret Inspect.302;
procedure List.18 (List.167, List.168, List.169):
let List.627 : U64 = 0i64;
let List.628 : U64 = CallByName List.6 List.167;
let List.626 : {Str, Int1} = CallByName List.96 List.167 List.168 List.169 List.627 List.628;
ret List.626;
procedure List.100 (#Derived_gen.8, #Derived_gen.9, #Derived_gen.10, #Derived_gen.11, #Derived_gen.12):
joinpoint List.662 List.174 List.175 List.176 List.177 List.178:
let List.664 : Int1 = CallByName Num.22 List.177 List.178;
if List.664 then
let List.668 : I64 = CallByName List.66 List.174 List.177;
let List.179 : {Str, Int1} = CallByName Inspect.160 List.175 List.668 List.176;
let List.667 : U64 = 1i64;
let List.666 : U64 = CallByName Num.51 List.177 List.667;
jump List.662 List.174 List.179 List.176 List.666 List.178;
else
dec List.174;
ret List.175;
in
inc #Derived_gen.8;
jump List.662 #Derived_gen.8 #Derived_gen.9 #Derived_gen.10 #Derived_gen.11 #Derived_gen.12;
procedure List.18 (List.171, List.172, List.173):
let List.660 : U64 = 0i64;
let List.661 : U64 = CallByName List.6 List.171;
let List.659 : {Str, Int1} = CallByName List.100 List.171 List.172 List.173 List.660 List.661;
ret List.659;
procedure List.6 (#Attr.2):
let List.637 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.637;
let List.670 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.670;
procedure List.66 (#Attr.2, #Attr.3):
let List.636 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.636;
procedure List.96 (#Derived_gen.19, #Derived_gen.20, #Derived_gen.21, #Derived_gen.22, #Derived_gen.23):
joinpoint List.629 List.170 List.171 List.172 List.173 List.174:
let List.631 : Int1 = CallByName Num.22 List.173 List.174;
if List.631 then
let List.635 : I64 = CallByName List.66 List.170 List.173;
let List.175 : {Str, Int1} = CallByName Inspect.160 List.171 List.635 List.172;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.51 List.173 List.634;
jump List.629 List.170 List.175 List.172 List.633 List.174;
else
dec List.170;
ret List.171;
in
inc #Derived_gen.19;
jump List.629 #Derived_gen.19 #Derived_gen.20 #Derived_gen.21 #Derived_gen.22 #Derived_gen.23;
let List.669 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.669;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.283 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -221,67 +221,67 @@ procedure Inspect.63 (Inspect.300, Inspect.296):
procedure Inspect.64 (Inspect.302):
ret Inspect.302;
procedure List.18 (List.167, List.168, List.169):
let List.627 : U64 = 0i64;
let List.628 : U64 = CallByName List.6 List.167;
let List.626 : {Str, Int1} = CallByName List.96 List.167 List.168 List.169 List.627 List.628;
ret List.626;
procedure List.100 (#Derived_gen.30, #Derived_gen.31, #Derived_gen.32, #Derived_gen.33, #Derived_gen.34):
joinpoint List.662 List.174 List.175 List.176 List.177 List.178:
let List.664 : Int1 = CallByName Num.22 List.177 List.178;
if List.664 then
let List.668 : {Str, Str} = CallByName List.66 List.174 List.177;
inc List.668;
let List.179 : {Str, Int1} = CallByName Inspect.233 List.175 List.668;
let List.667 : U64 = 1i64;
let List.666 : U64 = CallByName Num.51 List.177 List.667;
jump List.662 List.174 List.179 List.176 List.666 List.178;
else
dec List.174;
ret List.175;
in
inc #Derived_gen.30;
jump List.662 #Derived_gen.30 #Derived_gen.31 #Derived_gen.32 #Derived_gen.33 #Derived_gen.34;
procedure List.18 (List.167, List.168, List.169):
let List.639 : U64 = 0i64;
let List.640 : U64 = CallByName List.6 List.167;
let List.638 : {Str, Int1} = CallByName List.96 List.167 List.168 List.169 List.639 List.640;
ret List.638;
procedure List.100 (#Derived_gen.43, #Derived_gen.44, #Derived_gen.45, #Derived_gen.46, #Derived_gen.47):
joinpoint List.674 List.174 List.175 List.176 List.177 List.178:
let List.676 : Int1 = CallByName Num.22 List.177 List.178;
if List.676 then
let List.680 : {Str, Str} = CallByName List.66 List.174 List.177;
inc List.680;
let List.179 : {Str, Int1} = CallByName Inspect.233 List.175 List.680;
let List.679 : U64 = 1i64;
let List.678 : U64 = CallByName Num.51 List.177 List.679;
jump List.674 List.174 List.179 List.176 List.678 List.178;
else
dec List.174;
ret List.175;
in
inc #Derived_gen.43;
jump List.674 #Derived_gen.43 #Derived_gen.44 #Derived_gen.45 #Derived_gen.46 #Derived_gen.47;
procedure List.18 (List.171, List.172, List.173):
let List.660 : U64 = 0i64;
let List.661 : U64 = CallByName List.6 List.171;
let List.659 : {Str, Int1} = CallByName List.100 List.171 List.172 List.173 List.660 List.661;
ret List.659;
procedure List.18 (List.171, List.172, List.173):
let List.672 : U64 = 0i64;
let List.673 : U64 = CallByName List.6 List.171;
let List.671 : {Str, Int1} = CallByName List.100 List.171 List.172 List.173 List.672 List.673;
ret List.671;
procedure List.6 (#Attr.2):
let List.637 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.637;
let List.670 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.670;
procedure List.6 (#Attr.2):
let List.649 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.649;
let List.682 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.682;
procedure List.66 (#Attr.2, #Attr.3):
let List.636 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.636;
let List.669 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.669;
procedure List.66 (#Attr.2, #Attr.3):
let List.648 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.648;
procedure List.96 (#Derived_gen.28, #Derived_gen.29, #Derived_gen.30, #Derived_gen.31, #Derived_gen.32):
joinpoint List.641 List.170 List.171 List.172 List.173 List.174:
let List.643 : Int1 = CallByName Num.22 List.173 List.174;
if List.643 then
let List.647 : {Str, Str} = CallByName List.66 List.170 List.173;
inc List.647;
let List.175 : {Str, Int1} = CallByName Inspect.233 List.171 List.647;
let List.646 : U64 = 1i64;
let List.645 : U64 = CallByName Num.51 List.173 List.646;
jump List.641 List.170 List.175 List.172 List.645 List.174;
else
dec List.170;
ret List.171;
in
inc #Derived_gen.28;
jump List.641 #Derived_gen.28 #Derived_gen.29 #Derived_gen.30 #Derived_gen.31 #Derived_gen.32;
procedure List.96 (#Derived_gen.33, #Derived_gen.34, #Derived_gen.35, #Derived_gen.36, #Derived_gen.37):
joinpoint List.629 List.170 List.171 List.172 List.173 List.174:
let List.631 : Int1 = CallByName Num.22 List.173 List.174;
if List.631 then
let List.635 : {Str, Str} = CallByName List.66 List.170 List.173;
inc List.635;
let List.175 : {Str, Int1} = CallByName Inspect.233 List.171 List.635;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.51 List.173 List.634;
jump List.629 List.170 List.175 List.172 List.633 List.174;
else
dec List.170;
ret List.171;
in
inc #Derived_gen.33;
jump List.629 #Derived_gen.33 #Derived_gen.34 #Derived_gen.35 #Derived_gen.36 #Derived_gen.37;
let List.681 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.681;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.284 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -161,36 +161,36 @@ procedure Inspect.63 (Inspect.300, Inspect.296):
procedure Inspect.64 (Inspect.302):
ret Inspect.302;
procedure List.18 (List.167, List.168, List.169):
let List.627 : U64 = 0i64;
let List.628 : U64 = CallByName List.6 List.167;
let List.626 : {Str, Int1} = CallByName List.96 List.167 List.168 List.169 List.627 List.628;
ret List.626;
procedure List.6 (#Attr.2):
let List.637 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.637;
procedure List.66 (#Attr.2, #Attr.3):
let List.636 : {[C I64, C Decimal], Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.636;
procedure List.96 (#Derived_gen.22, #Derived_gen.23, #Derived_gen.24, #Derived_gen.25, #Derived_gen.26):
joinpoint List.629 List.170 List.171 List.172 List.173 List.174:
let List.631 : Int1 = CallByName Num.22 List.173 List.174;
if List.631 then
let List.635 : {[C I64, C Decimal], Str} = CallByName List.66 List.170 List.173;
inc List.635;
let List.175 : {Str, Int1} = CallByName Inspect.233 List.171 List.635;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.51 List.173 List.634;
jump List.629 List.170 List.175 List.172 List.633 List.174;
procedure List.100 (#Derived_gen.22, #Derived_gen.23, #Derived_gen.24, #Derived_gen.25, #Derived_gen.26):
joinpoint List.662 List.174 List.175 List.176 List.177 List.178:
let List.664 : Int1 = CallByName Num.22 List.177 List.178;
if List.664 then
let List.668 : {[C I64, C Decimal], Str} = CallByName List.66 List.174 List.177;
inc List.668;
let List.179 : {Str, Int1} = CallByName Inspect.233 List.175 List.668;
let List.667 : U64 = 1i64;
let List.666 : U64 = CallByName Num.51 List.177 List.667;
jump List.662 List.174 List.179 List.176 List.666 List.178;
else
dec List.170;
ret List.171;
dec List.174;
ret List.175;
in
inc #Derived_gen.22;
jump List.629 #Derived_gen.22 #Derived_gen.23 #Derived_gen.24 #Derived_gen.25 #Derived_gen.26;
jump List.662 #Derived_gen.22 #Derived_gen.23 #Derived_gen.24 #Derived_gen.25 #Derived_gen.26;
procedure List.18 (List.171, List.172, List.173):
let List.660 : U64 = 0i64;
let List.661 : U64 = CallByName List.6 List.171;
let List.659 : {Str, Int1} = CallByName List.100 List.171 List.172 List.173 List.660 List.661;
ret List.659;
procedure List.6 (#Attr.2):
let List.670 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.670;
procedure List.66 (#Attr.2, #Attr.3):
let List.669 : {[C I64, C Decimal], Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.669;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.284 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -139,36 +139,36 @@ procedure Inspect.63 (Inspect.300, Inspect.296):
procedure Inspect.64 (Inspect.302):
ret Inspect.302;
procedure List.18 (List.167, List.168, List.169):
let List.627 : U64 = 0i64;
let List.628 : U64 = CallByName List.6 List.167;
let List.626 : {Str, Int1} = CallByName List.96 List.167 List.168 List.169 List.627 List.628;
ret List.626;
procedure List.100 (#Derived_gen.12, #Derived_gen.13, #Derived_gen.14, #Derived_gen.15, #Derived_gen.16):
joinpoint List.662 List.174 List.175 List.176 List.177 List.178:
let List.664 : Int1 = CallByName Num.22 List.177 List.178;
if List.664 then
let List.668 : {Str, Str} = CallByName List.66 List.174 List.177;
inc List.668;
let List.179 : {Str, Int1} = CallByName Inspect.233 List.175 List.668;
let List.667 : U64 = 1i64;
let List.666 : U64 = CallByName Num.51 List.177 List.667;
jump List.662 List.174 List.179 List.176 List.666 List.178;
else
dec List.174;
ret List.175;
in
inc #Derived_gen.12;
jump List.662 #Derived_gen.12 #Derived_gen.13 #Derived_gen.14 #Derived_gen.15 #Derived_gen.16;
procedure List.18 (List.171, List.172, List.173):
let List.660 : U64 = 0i64;
let List.661 : U64 = CallByName List.6 List.171;
let List.659 : {Str, Int1} = CallByName List.100 List.171 List.172 List.173 List.660 List.661;
ret List.659;
procedure List.6 (#Attr.2):
let List.637 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.637;
let List.670 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.670;
procedure List.66 (#Attr.2, #Attr.3):
let List.636 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.636;
procedure List.96 (#Derived_gen.16, #Derived_gen.17, #Derived_gen.18, #Derived_gen.19, #Derived_gen.20):
joinpoint List.629 List.170 List.171 List.172 List.173 List.174:
let List.631 : Int1 = CallByName Num.22 List.173 List.174;
if List.631 then
let List.635 : {Str, Str} = CallByName List.66 List.170 List.173;
inc List.635;
let List.175 : {Str, Int1} = CallByName Inspect.233 List.171 List.635;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.51 List.173 List.634;
jump List.629 List.170 List.175 List.172 List.633 List.174;
else
dec List.170;
ret List.171;
in
inc #Derived_gen.16;
jump List.629 #Derived_gen.16 #Derived_gen.17 #Derived_gen.18 #Derived_gen.19 #Derived_gen.20;
let List.669 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.669;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.282 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -146,36 +146,36 @@ procedure Inspect.63 (Inspect.300, Inspect.296):
procedure Inspect.64 (Inspect.302):
ret Inspect.302;
procedure List.18 (List.167, List.168, List.169):
let List.627 : U64 = 0i64;
let List.628 : U64 = CallByName List.6 List.167;
let List.626 : {Str, Int1} = CallByName List.96 List.167 List.168 List.169 List.627 List.628;
ret List.626;
procedure List.100 (#Derived_gen.16, #Derived_gen.17, #Derived_gen.18, #Derived_gen.19, #Derived_gen.20):
joinpoint List.662 List.174 List.175 List.176 List.177 List.178:
let List.664 : Int1 = CallByName Num.22 List.177 List.178;
if List.664 then
let List.668 : {Str, Str} = CallByName List.66 List.174 List.177;
inc List.668;
let List.179 : {Str, Int1} = CallByName Inspect.233 List.175 List.668;
let List.667 : U64 = 1i64;
let List.666 : U64 = CallByName Num.51 List.177 List.667;
jump List.662 List.174 List.179 List.176 List.666 List.178;
else
dec List.174;
ret List.175;
in
inc #Derived_gen.16;
jump List.662 #Derived_gen.16 #Derived_gen.17 #Derived_gen.18 #Derived_gen.19 #Derived_gen.20;
procedure List.18 (List.171, List.172, List.173):
let List.660 : U64 = 0i64;
let List.661 : U64 = CallByName List.6 List.171;
let List.659 : {Str, Int1} = CallByName List.100 List.171 List.172 List.173 List.660 List.661;
ret List.659;
procedure List.6 (#Attr.2):
let List.637 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.637;
let List.670 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.670;
procedure List.66 (#Attr.2, #Attr.3):
let List.636 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.636;
procedure List.96 (#Derived_gen.20, #Derived_gen.21, #Derived_gen.22, #Derived_gen.23, #Derived_gen.24):
joinpoint List.629 List.170 List.171 List.172 List.173 List.174:
let List.631 : Int1 = CallByName Num.22 List.173 List.174;
if List.631 then
let List.635 : {Str, Str} = CallByName List.66 List.170 List.173;
inc List.635;
let List.175 : {Str, Int1} = CallByName Inspect.233 List.171 List.635;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.51 List.173 List.634;
jump List.629 List.170 List.175 List.172 List.633 List.174;
else
dec List.170;
ret List.171;
in
inc #Derived_gen.20;
jump List.629 #Derived_gen.20 #Derived_gen.21 #Derived_gen.22 #Derived_gen.23 #Derived_gen.24;
let List.669 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.669;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.282 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -132,43 +132,43 @@ procedure Inspect.63 (Inspect.300, Inspect.296):
procedure Inspect.64 (Inspect.302):
ret Inspect.302;
procedure List.1 (List.114):
let List.639 : U64 = CallByName List.6 List.114;
let List.640 : U64 = 0i64;
let List.638 : Int1 = CallByName Bool.11 List.639 List.640;
ret List.638;
procedure List.1 (List.118):
let List.672 : U64 = CallByName List.6 List.118;
let List.673 : U64 = 0i64;
let List.671 : Int1 = CallByName Bool.11 List.672 List.673;
ret List.671;
procedure List.18 (List.167, List.168, List.169):
let List.627 : U64 = 0i64;
let List.628 : U64 = CallByName List.6 List.167;
let List.626 : Str = CallByName List.96 List.167 List.168 List.169 List.627 List.628;
ret List.626;
procedure List.100 (#Derived_gen.14, #Derived_gen.15, #Derived_gen.16, #Derived_gen.17, #Derived_gen.18):
joinpoint List.662 List.174 List.175 List.176 List.177 List.178:
let List.664 : Int1 = CallByName Num.22 List.177 List.178;
if List.664 then
let List.668 : Str = CallByName List.66 List.174 List.177;
inc List.668;
let List.179 : Str = CallByName Inspect.210 List.175 List.668;
dec List.668;
let List.667 : U64 = 1i64;
let List.666 : U64 = CallByName Num.51 List.177 List.667;
jump List.662 List.174 List.179 List.176 List.666 List.178;
else
dec List.174;
ret List.175;
in
inc #Derived_gen.14;
jump List.662 #Derived_gen.14 #Derived_gen.15 #Derived_gen.16 #Derived_gen.17 #Derived_gen.18;
procedure List.18 (List.171, List.172, List.173):
let List.660 : U64 = 0i64;
let List.661 : U64 = CallByName List.6 List.171;
let List.659 : Str = CallByName List.100 List.171 List.172 List.173 List.660 List.661;
ret List.659;
procedure List.6 (#Attr.2):
let List.637 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.637;
let List.670 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.670;
procedure List.66 (#Attr.2, #Attr.3):
let List.636 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.636;
procedure List.96 (#Derived_gen.20, #Derived_gen.21, #Derived_gen.22, #Derived_gen.23, #Derived_gen.24):
joinpoint List.629 List.170 List.171 List.172 List.173 List.174:
let List.631 : Int1 = CallByName Num.22 List.173 List.174;
if List.631 then
let List.635 : Str = CallByName List.66 List.170 List.173;
inc List.635;
let List.175 : Str = CallByName Inspect.210 List.171 List.635;
dec List.635;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.51 List.173 List.634;
jump List.629 List.170 List.175 List.172 List.633 List.174;
else
dec List.170;
ret List.171;
in
inc #Derived_gen.20;
jump List.629 #Derived_gen.20 #Derived_gen.21 #Derived_gen.22 #Derived_gen.23 #Derived_gen.24;
let List.669 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.669;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.282 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -135,43 +135,43 @@ procedure Inspect.63 (Inspect.300, Inspect.296):
procedure Inspect.64 (Inspect.302):
ret Inspect.302;
procedure List.1 (List.114):
let List.639 : U64 = CallByName List.6 List.114;
let List.640 : U64 = 0i64;
let List.638 : Int1 = CallByName Bool.11 List.639 List.640;
ret List.638;
procedure List.1 (List.118):
let List.672 : U64 = CallByName List.6 List.118;
let List.673 : U64 = 0i64;
let List.671 : Int1 = CallByName Bool.11 List.672 List.673;
ret List.671;
procedure List.18 (List.167, List.168, List.169):
let List.627 : U64 = 0i64;
let List.628 : U64 = CallByName List.6 List.167;
let List.626 : Str = CallByName List.96 List.167 List.168 List.169 List.627 List.628;
ret List.626;
procedure List.6 (#Attr.2):
let List.637 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.637;
procedure List.66 (#Attr.2, #Attr.3):
let List.636 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.636;
procedure List.96 (#Derived_gen.13, #Derived_gen.14, #Derived_gen.15, #Derived_gen.16, #Derived_gen.17):
joinpoint List.629 List.170 List.171 List.172 List.173 List.174:
let List.631 : Int1 = CallByName Num.22 List.173 List.174;
if List.631 then
let List.635 : Str = CallByName List.66 List.170 List.173;
inc List.635;
let List.175 : Str = CallByName Inspect.210 List.171 List.635;
dec List.635;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.51 List.173 List.634;
jump List.629 List.170 List.175 List.172 List.633 List.174;
procedure List.100 (#Derived_gen.13, #Derived_gen.14, #Derived_gen.15, #Derived_gen.16, #Derived_gen.17):
joinpoint List.662 List.174 List.175 List.176 List.177 List.178:
let List.664 : Int1 = CallByName Num.22 List.177 List.178;
if List.664 then
let List.668 : Str = CallByName List.66 List.174 List.177;
inc List.668;
let List.179 : Str = CallByName Inspect.210 List.175 List.668;
dec List.668;
let List.667 : U64 = 1i64;
let List.666 : U64 = CallByName Num.51 List.177 List.667;
jump List.662 List.174 List.179 List.176 List.666 List.178;
else
dec List.170;
ret List.171;
dec List.174;
ret List.175;
in
inc #Derived_gen.13;
jump List.629 #Derived_gen.13 #Derived_gen.14 #Derived_gen.15 #Derived_gen.16 #Derived_gen.17;
jump List.662 #Derived_gen.13 #Derived_gen.14 #Derived_gen.15 #Derived_gen.16 #Derived_gen.17;
procedure List.18 (List.171, List.172, List.173):
let List.660 : U64 = 0i64;
let List.661 : U64 = CallByName List.6 List.171;
let List.659 : Str = CallByName List.100 List.171 List.172 List.173 List.660 List.661;
ret List.659;
procedure List.6 (#Attr.2):
let List.670 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.670;
procedure List.66 (#Attr.2, #Attr.3):
let List.669 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.669;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.282 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,6 +1,6 @@
procedure List.6 (#Attr.2):
let List.626 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.626;
let List.659 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.659;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.283 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;

View file

@ -6,40 +6,40 @@ procedure Bool.2 ():
let Bool.23 : Int1 = true;
ret Bool.23;
procedure List.2 (List.115, List.116):
let List.640 : U64 = CallByName List.6 List.115;
let List.636 : Int1 = CallByName Num.22 List.116 List.640;
if List.636 then
let List.638 : I64 = CallByName List.66 List.115 List.116;
let List.637 : [C {}, C I64] = TagId(1) List.638;
ret List.637;
procedure List.2 (List.119, List.120):
let List.673 : U64 = CallByName List.6 List.119;
let List.669 : Int1 = CallByName Num.22 List.120 List.673;
if List.669 then
let List.671 : I64 = CallByName List.66 List.119 List.120;
let List.670 : [C {}, C I64] = TagId(1) List.671;
ret List.670;
else
let List.635 : {} = Struct {};
let List.634 : [C {}, C I64] = TagId(0) List.635;
ret List.634;
let List.668 : {} = Struct {};
let List.667 : [C {}, C I64] = TagId(0) List.668;
ret List.667;
procedure List.6 (#Attr.2):
let List.641 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.641;
let List.674 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.674;
procedure List.66 (#Attr.2, #Attr.3):
let List.639 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.639;
let List.672 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.672;
procedure List.9 (List.387):
let List.633 : U64 = 0i64;
let List.626 : [C {}, C I64] = CallByName List.2 List.387 List.633;
let List.630 : U8 = 1i64;
let List.631 : U8 = GetTagId List.626;
let List.632 : Int1 = lowlevel Eq List.630 List.631;
if List.632 then
let List.388 : I64 = UnionAtIndex (Id 1) (Index 0) List.626;
let List.627 : [C Int1, C I64] = TagId(1) List.388;
ret List.627;
procedure List.9 (List.391):
let List.666 : U64 = 0i64;
let List.659 : [C {}, C I64] = CallByName List.2 List.391 List.666;
let List.663 : U8 = 1i64;
let List.664 : U8 = GetTagId List.659;
let List.665 : Int1 = lowlevel Eq List.663 List.664;
if List.665 then
let List.392 : I64 = UnionAtIndex (Id 1) (Index 0) List.659;
let List.660 : [C Int1, C I64] = TagId(1) List.392;
ret List.660;
else
let List.629 : Int1 = true;
let List.628 : [C Int1, C I64] = TagId(0) List.629;
ret List.628;
let List.662 : Int1 = true;
let List.661 : [C Int1, C I64] = TagId(0) List.662;
ret List.661;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.281 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -6,118 +6,118 @@ procedure Bool.2 ():
let Bool.24 : Int1 = true;
ret Bool.24;
procedure List.101 (#Derived_gen.1, #Derived_gen.2, #Derived_gen.3, #Derived_gen.4, #Derived_gen.5, #Derived_gen.6):
joinpoint List.664 List.286 List.287 List.288 List.289 List.290 List.291:
let List.666 : Int1 = CallByName Num.22 List.290 List.291;
if List.666 then
let List.672 : [<r>C I64, C List *self] = CallByName List.66 List.286 List.290;
inc List.672;
let List.673 : [<r>C I64, C List *self] = CallByName List.66 List.287 List.290;
inc List.673;
let List.292 : {[<r>C I64, C List *self], [<r>C I64, C List *self]} = CallByName Test.15 List.672 List.673;
let List.668 : List {[<r>C I64, C List *self], [<r>C I64, C List *self]} = CallByName List.71 List.288 List.292;
let List.670 : U64 = 1i64;
let List.669 : U64 = CallByName Num.51 List.290 List.670;
jump List.664 List.286 List.287 List.668 List.289 List.669 List.291;
procedure List.105 (#Derived_gen.6, #Derived_gen.7, #Derived_gen.8, #Derived_gen.9, #Derived_gen.10, #Derived_gen.11):
joinpoint List.697 List.290 List.291 List.292 List.293 List.294 List.295:
let List.699 : Int1 = CallByName Num.22 List.294 List.295;
if List.699 then
let List.705 : [<r>C I64, C List *self] = CallByName List.66 List.290 List.294;
inc List.705;
let List.706 : [<r>C I64, C List *self] = CallByName List.66 List.291 List.294;
inc List.706;
let List.296 : {[<r>C I64, C List *self], [<r>C I64, C List *self]} = CallByName Test.15 List.705 List.706;
let List.701 : List {[<r>C I64, C List *self], [<r>C I64, C List *self]} = CallByName List.71 List.292 List.296;
let List.703 : U64 = 1i64;
let List.702 : U64 = CallByName Num.51 List.294 List.703;
jump List.697 List.290 List.291 List.701 List.293 List.702 List.295;
else
dec List.286;
dec List.287;
ret List.288;
dec List.291;
dec List.290;
ret List.292;
in
inc #Derived_gen.1;
inc #Derived_gen.2;
jump List.664 #Derived_gen.1 #Derived_gen.2 #Derived_gen.3 #Derived_gen.4 #Derived_gen.5 #Derived_gen.6;
inc #Derived_gen.6;
inc #Derived_gen.7;
jump List.697 #Derived_gen.6 #Derived_gen.7 #Derived_gen.8 #Derived_gen.9 #Derived_gen.10 #Derived_gen.11;
procedure List.111 (List.540, List.541, List.542):
let List.640 : U64 = 0i64;
let List.641 : U64 = CallByName List.6 List.540;
let List.639 : [C {}, C {}] = CallByName List.80 List.540 List.541 List.542 List.640 List.641;
ret List.639;
procedure List.115 (List.562, List.563, List.564):
let List.673 : U64 = 0i64;
let List.674 : U64 = CallByName List.6 List.562;
let List.672 : [C {}, C {}] = CallByName List.80 List.562 List.563 List.564 List.673 List.674;
ret List.672;
procedure List.23 (List.282, List.283, List.284):
let List.676 : U64 = CallByName List.6 List.282;
let List.677 : U64 = CallByName List.6 List.283;
let List.285 : U64 = CallByName Num.148 List.676 List.677;
let List.662 : List {[<r>C I64, C List *self], [<r>C I64, C List *self]} = CallByName List.68 List.285;
let List.663 : U64 = 0i64;
let List.661 : List {[<r>C I64, C List *self], [<r>C I64, C List *self]} = CallByName List.101 List.282 List.283 List.662 List.284 List.663 List.285;
ret List.661;
procedure List.23 (List.286, List.287, List.288):
let List.709 : U64 = CallByName List.6 List.286;
let List.710 : U64 = CallByName List.6 List.287;
let List.289 : U64 = CallByName Num.148 List.709 List.710;
let List.695 : List {[<r>C I64, C List *self], [<r>C I64, C List *self]} = CallByName List.68 List.289;
let List.696 : U64 = 0i64;
let List.694 : List {[<r>C I64, C List *self], [<r>C I64, C List *self]} = CallByName List.105 List.286 List.287 List.695 List.288 List.696 List.289;
ret List.694;
procedure List.243 (List.628, List.244, List.242):
let List.658 : Int1 = CallByName Test.1 List.244;
if List.658 then
let List.660 : {} = Struct {};
let List.659 : [C {}, C {}] = TagId(1) List.660;
ret List.659;
procedure List.247 (List.661, List.248, List.246):
let List.691 : Int1 = CallByName Test.1 List.248;
if List.691 then
let List.693 : {} = Struct {};
let List.692 : [C {}, C {}] = TagId(1) List.693;
ret List.692;
else
let List.657 : {} = Struct {};
let List.656 : [C {}, C {}] = TagId(0) List.657;
ret List.656;
let List.690 : {} = Struct {};
let List.689 : [C {}, C {}] = TagId(0) List.690;
ret List.689;
procedure List.56 (List.241, List.242):
let List.637 : {} = Struct {};
let List.629 : [C {}, C {}] = CallByName List.111 List.241 List.637 List.242;
let List.634 : U8 = 1i64;
let List.635 : U8 = GetTagId List.629;
let List.636 : Int1 = lowlevel Eq List.634 List.635;
if List.636 then
let List.630 : Int1 = CallByName Bool.2;
ret List.630;
procedure List.56 (List.245, List.246):
let List.670 : {} = Struct {};
let List.662 : [C {}, C {}] = CallByName List.115 List.245 List.670 List.246;
let List.667 : U8 = 1i64;
let List.668 : U8 = GetTagId List.662;
let List.669 : Int1 = lowlevel Eq List.667 List.668;
if List.669 then
let List.663 : Int1 = CallByName Bool.2;
ret List.663;
else
let List.631 : Int1 = CallByName Bool.1;
ret List.631;
let List.664 : Int1 = CallByName Bool.1;
ret List.664;
procedure List.6 (#Attr.2):
let List.627 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.627;
let List.660 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.660;
procedure List.6 (#Attr.2):
let List.655 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.655;
let List.688 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.688;
procedure List.66 (#Attr.2, #Attr.3):
let List.654 : {[<r>C I64, C List *self], [<r>C I64, C List *self]} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.654;
let List.687 : {[<r>C I64, C List *self], [<r>C I64, C List *self]} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.687;
procedure List.66 (#Attr.2, #Attr.3):
let List.674 : [<r>C I64, C List *self] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.674;
let List.707 : [<r>C I64, C List *self] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.707;
procedure List.68 (#Attr.2):
let List.675 : List {[<r>C I64, C List *self], [<r>C I64, C List *self]} = lowlevel ListWithCapacity #Attr.2;
ret List.675;
let List.708 : List {[<r>C I64, C List *self], [<r>C I64, C List *self]} = lowlevel ListWithCapacity #Attr.2;
ret List.708;
procedure List.71 (#Attr.2, #Attr.3):
let List.671 : List {[<r>C I64, C List *self], [<r>C I64, C List *self]} = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.671;
let List.704 : List {[<r>C I64, C List *self], [<r>C I64, C List *self]} = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.704;
procedure List.80 (#Derived_gen.7, #Derived_gen.8, #Derived_gen.9, #Derived_gen.10, #Derived_gen.11):
joinpoint List.642 List.543 List.544 List.545 List.546 List.547:
let List.644 : Int1 = CallByName Num.22 List.546 List.547;
if List.644 then
let List.653 : {[<r>C I64, C List *self], [<r>C I64, C List *self]} = CallByName List.66 List.543 List.546;
inc List.653;
let List.645 : [C {}, C {}] = CallByName List.243 List.544 List.653 List.545;
let List.650 : U8 = 1i64;
let List.651 : U8 = GetTagId List.645;
let List.652 : Int1 = lowlevel Eq List.650 List.651;
if List.652 then
let List.548 : {} = UnionAtIndex (Id 1) (Index 0) List.645;
let List.648 : U64 = 1i64;
let List.647 : U64 = CallByName Num.51 List.546 List.648;
jump List.642 List.543 List.548 List.545 List.647 List.547;
procedure List.80 (#Derived_gen.0, #Derived_gen.1, #Derived_gen.2, #Derived_gen.3, #Derived_gen.4):
joinpoint List.675 List.565 List.566 List.567 List.568 List.569:
let List.677 : Int1 = CallByName Num.22 List.568 List.569;
if List.677 then
let List.686 : {[<r>C I64, C List *self], [<r>C I64, C List *self]} = CallByName List.66 List.565 List.568;
inc List.686;
let List.678 : [C {}, C {}] = CallByName List.247 List.566 List.686 List.567;
let List.683 : U8 = 1i64;
let List.684 : U8 = GetTagId List.678;
let List.685 : Int1 = lowlevel Eq List.683 List.684;
if List.685 then
let List.570 : {} = UnionAtIndex (Id 1) (Index 0) List.678;
let List.681 : U64 = 1i64;
let List.680 : U64 = CallByName Num.51 List.568 List.681;
jump List.675 List.565 List.570 List.567 List.680 List.569;
else
dec List.543;
let List.549 : {} = UnionAtIndex (Id 0) (Index 0) List.645;
let List.649 : [C {}, C {}] = TagId(0) List.549;
ret List.649;
dec List.565;
let List.571 : {} = UnionAtIndex (Id 0) (Index 0) List.678;
let List.682 : [C {}, C {}] = TagId(0) List.571;
ret List.682;
else
dec List.543;
let List.643 : [C {}, C {}] = TagId(1) List.544;
ret List.643;
dec List.565;
let List.676 : [C {}, C {}] = TagId(1) List.566;
ret List.676;
in
inc #Derived_gen.7;
jump List.642 #Derived_gen.7 #Derived_gen.8 #Derived_gen.9 #Derived_gen.10 #Derived_gen.11;
inc #Derived_gen.0;
jump List.675 #Derived_gen.0 #Derived_gen.1 #Derived_gen.2 #Derived_gen.3 #Derived_gen.4;
procedure Num.148 (Num.225, Num.226):
let Num.288 : Int1 = CallByName Num.22 Num.225 Num.226;
@ -138,7 +138,7 @@ procedure Num.51 (#Attr.2, #Attr.3):
let Num.284 : U64 = lowlevel NumAddWrap #Attr.2 #Attr.3;
ret Num.284;
procedure Test.1 (#Derived_gen.0):
procedure Test.1 (#Derived_gen.5):
joinpoint Test.26 Test.6:
let Test.65 : [<r>C I64, C List *self] = StructAtIndex 1 Test.6;
let Test.66 : U8 = 0i64;
@ -220,7 +220,7 @@ procedure Test.1 (#Derived_gen.0):
let Test.44 : {[<r>C I64, C List *self], [<r>C I64, C List *self]} = Struct {Test.45, Test.46};
jump Test.26 Test.44;
in
jump Test.26 #Derived_gen.0;
jump Test.26 #Derived_gen.5;
procedure Test.15 (Test.16, Test.17):
let Test.36 : {[<r>C I64, C List *self], [<r>C I64, C List *self]} = Struct {Test.16, Test.17};

View file

@ -1,33 +1,33 @@
procedure List.18 (List.167, List.168, List.169):
let List.627 : U64 = 0i64;
let List.628 : U64 = CallByName List.6 List.167;
let List.626 : [<rnu><null>, C {[<rnu>C *self, <null>], *self}] = CallByName List.96 List.167 List.168 List.169 List.627 List.628;
ret List.626;
procedure List.6 (#Attr.2):
let List.637 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.637;
procedure List.66 (#Attr.2, #Attr.3):
let List.636 : [<rnu>C *self, <null>] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.636;
procedure List.96 (#Derived_gen.0, #Derived_gen.1, #Derived_gen.2, #Derived_gen.3, #Derived_gen.4):
joinpoint List.629 List.170 List.171 List.172 List.173 List.174:
let List.631 : Int1 = CallByName Num.22 List.173 List.174;
if List.631 then
let List.635 : [<rnu>C *self, <null>] = CallByName List.66 List.170 List.173;
inc List.635;
let List.175 : [<rnu><null>, C {[<rnu>C *self, <null>], *self}] = CallByName Test.7 List.171 List.635;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.51 List.173 List.634;
jump List.629 List.170 List.175 List.172 List.633 List.174;
procedure List.100 (#Derived_gen.0, #Derived_gen.1, #Derived_gen.2, #Derived_gen.3, #Derived_gen.4):
joinpoint List.662 List.174 List.175 List.176 List.177 List.178:
let List.664 : Int1 = CallByName Num.22 List.177 List.178;
if List.664 then
let List.668 : [<rnu>C *self, <null>] = CallByName List.66 List.174 List.177;
inc List.668;
let List.179 : [<rnu><null>, C {[<rnu>C *self, <null>], *self}] = CallByName Test.7 List.175 List.668;
let List.667 : U64 = 1i64;
let List.666 : U64 = CallByName Num.51 List.177 List.667;
jump List.662 List.174 List.179 List.176 List.666 List.178;
else
dec List.170;
ret List.171;
dec List.174;
ret List.175;
in
inc #Derived_gen.0;
jump List.629 #Derived_gen.0 #Derived_gen.1 #Derived_gen.2 #Derived_gen.3 #Derived_gen.4;
jump List.662 #Derived_gen.0 #Derived_gen.1 #Derived_gen.2 #Derived_gen.3 #Derived_gen.4;
procedure List.18 (List.171, List.172, List.173):
let List.660 : U64 = 0i64;
let List.661 : U64 = CallByName List.6 List.171;
let List.659 : [<rnu><null>, C {[<rnu>C *self, <null>], *self}] = CallByName List.100 List.171 List.172 List.173 List.660 List.661;
ret List.659;
procedure List.6 (#Attr.2):
let List.670 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.670;
procedure List.66 (#Attr.2, #Attr.3):
let List.669 : [<rnu>C *self, <null>] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.669;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.282 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,16 +1,16 @@
procedure List.4 (List.131, List.132):
let List.629 : U64 = 1i64;
let List.627 : List I64 = CallByName List.70 List.131 List.629;
let List.626 : List I64 = CallByName List.71 List.627 List.132;
ret List.626;
procedure List.4 (List.135, List.136):
let List.662 : U64 = 1i64;
let List.660 : List I64 = CallByName List.70 List.135 List.662;
let List.659 : List I64 = CallByName List.71 List.660 List.136;
ret List.659;
procedure List.70 (#Attr.2, #Attr.3):
let List.630 : List I64 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.630;
let List.663 : List I64 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.663;
procedure List.71 (#Attr.2, #Attr.3):
let List.628 : List I64 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.628;
let List.661 : List I64 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.661;
procedure Test.0 ():
let Test.2 : List I64 = Array [1i64];

View file

@ -1,16 +1,16 @@
procedure List.4 (List.131, List.132):
let List.629 : U64 = 1i64;
let List.627 : List I64 = CallByName List.70 List.131 List.629;
let List.626 : List I64 = CallByName List.71 List.627 List.132;
ret List.626;
procedure List.4 (List.135, List.136):
let List.662 : U64 = 1i64;
let List.660 : List I64 = CallByName List.70 List.135 List.662;
let List.659 : List I64 = CallByName List.71 List.660 List.136;
ret List.659;
procedure List.70 (#Attr.2, #Attr.3):
let List.630 : List I64 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.630;
let List.663 : List I64 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.663;
procedure List.71 (#Attr.2, #Attr.3):
let List.628 : List I64 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.628;
let List.661 : List I64 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.661;
procedure Test.1 (Test.2):
let Test.6 : I64 = 42i64;

View file

@ -1,25 +1,25 @@
procedure List.3 (List.123, List.124, List.125):
let List.629 : {List I64, I64} = CallByName List.64 List.123 List.124 List.125;
let List.628 : List I64 = StructAtIndex 0 List.629;
ret List.628;
procedure List.3 (List.127, List.128, List.129):
let List.662 : {List I64, I64} = CallByName List.64 List.127 List.128 List.129;
let List.661 : List I64 = StructAtIndex 0 List.662;
ret List.661;
procedure List.6 (#Attr.2):
let List.627 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.627;
let List.660 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.660;
procedure List.64 (List.120, List.121, List.122):
let List.634 : U64 = CallByName List.6 List.120;
let List.631 : Int1 = CallByName Num.22 List.121 List.634;
if List.631 then
let List.632 : {List I64, I64} = CallByName List.67 List.120 List.121 List.122;
ret List.632;
procedure List.64 (List.124, List.125, List.126):
let List.667 : U64 = CallByName List.6 List.124;
let List.664 : Int1 = CallByName Num.22 List.125 List.667;
if List.664 then
let List.665 : {List I64, I64} = CallByName List.67 List.124 List.125 List.126;
ret List.665;
else
let List.630 : {List I64, I64} = Struct {List.120, List.122};
ret List.630;
let List.663 : {List I64, I64} = Struct {List.124, List.126};
ret List.663;
procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
let List.633 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.633;
let List.666 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.666;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.281 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;

View file

@ -1,22 +1,22 @@
procedure List.2 (List.115, List.116):
let List.632 : U64 = CallByName List.6 List.115;
let List.628 : Int1 = CallByName Num.22 List.116 List.632;
if List.628 then
let List.630 : I64 = CallByName List.66 List.115 List.116;
let List.629 : [C {}, C I64] = TagId(1) List.630;
ret List.629;
procedure List.2 (List.119, List.120):
let List.665 : U64 = CallByName List.6 List.119;
let List.661 : Int1 = CallByName Num.22 List.120 List.665;
if List.661 then
let List.663 : I64 = CallByName List.66 List.119 List.120;
let List.662 : [C {}, C I64] = TagId(1) List.663;
ret List.662;
else
let List.627 : {} = Struct {};
let List.626 : [C {}, C I64] = TagId(0) List.627;
ret List.626;
let List.660 : {} = Struct {};
let List.659 : [C {}, C I64] = TagId(0) List.660;
ret List.659;
procedure List.6 (#Attr.2):
let List.633 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.633;
let List.666 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.666;
procedure List.66 (#Attr.2, #Attr.3):
let List.631 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.631;
let List.664 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.664;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.281 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,10 +1,10 @@
procedure List.6 (#Attr.2):
let List.626 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.626;
let List.659 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.659;
procedure List.6 (#Attr.2):
let List.627 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.627;
let List.660 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.660;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.281 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;

View file

@ -1,66 +1,66 @@
procedure List.18 (List.167, List.168, List.169):
let List.638 : U64 = 0i64;
let List.639 : U64 = CallByName List.6 List.167;
let List.637 : List Str = CallByName List.96 List.167 List.168 List.169 List.638 List.639;
ret List.637;
procedure List.100 (#Derived_gen.3, #Derived_gen.4, #Derived_gen.5, #Derived_gen.6, #Derived_gen.7):
joinpoint List.673 List.174 List.175 List.176 List.177 List.178:
let List.675 : Int1 = CallByName Num.22 List.177 List.178;
if List.675 then
let List.679 : Str = CallByName List.66 List.174 List.177;
inc List.679;
let List.179 : List Str = CallByName List.283 List.175 List.679 List.176;
dec List.679;
let List.678 : U64 = 1i64;
let List.677 : U64 = CallByName Num.51 List.177 List.678;
jump List.673 List.174 List.179 List.176 List.677 List.178;
else
dec List.174;
ret List.175;
in
inc #Derived_gen.3;
jump List.673 #Derived_gen.3 #Derived_gen.4 #Derived_gen.5 #Derived_gen.6 #Derived_gen.7;
procedure List.2 (List.115, List.116):
let List.632 : U64 = CallByName List.6 List.115;
let List.628 : Int1 = CallByName Num.22 List.116 List.632;
if List.628 then
let List.630 : Str = CallByName List.66 List.115 List.116;
inc List.630;
let List.629 : [C {}, C Str] = TagId(1) List.630;
ret List.629;
procedure List.18 (List.171, List.172, List.173):
let List.671 : U64 = 0i64;
let List.672 : U64 = CallByName List.6 List.171;
let List.670 : List Str = CallByName List.100 List.171 List.172 List.173 List.671 List.672;
ret List.670;
procedure List.2 (List.119, List.120):
let List.665 : U64 = CallByName List.6 List.119;
let List.661 : Int1 = CallByName Num.22 List.120 List.665;
if List.661 then
let List.663 : Str = CallByName List.66 List.119 List.120;
inc List.663;
let List.662 : [C {}, C Str] = TagId(1) List.663;
ret List.662;
else
let List.627 : {} = Struct {};
let List.626 : [C {}, C Str] = TagId(0) List.627;
ret List.626;
let List.660 : {} = Struct {};
let List.659 : [C {}, C Str] = TagId(0) List.660;
ret List.659;
procedure List.279 (List.280, List.281, List.277):
let List.649 : Str = CallByName Test.3 List.281;
let List.648 : List Str = CallByName List.71 List.280 List.649;
ret List.648;
procedure List.283 (List.284, List.285, List.281):
let List.682 : Str = CallByName Test.3 List.285;
let List.681 : List Str = CallByName List.71 List.284 List.682;
ret List.681;
procedure List.5 (List.276, List.277):
let List.278 : U64 = CallByName List.6 List.276;
let List.635 : List Str = CallByName List.68 List.278;
let List.634 : List Str = CallByName List.18 List.276 List.635 List.277;
ret List.634;
procedure List.5 (List.280, List.281):
let List.282 : U64 = CallByName List.6 List.280;
let List.668 : List Str = CallByName List.68 List.282;
let List.667 : List Str = CallByName List.18 List.280 List.668 List.281;
ret List.667;
procedure List.6 (#Attr.2):
let List.633 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.633;
let List.666 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.666;
procedure List.66 (#Attr.2, #Attr.3):
let List.631 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.631;
let List.664 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.664;
procedure List.68 (#Attr.2):
let List.651 : List Str = lowlevel ListWithCapacity #Attr.2;
ret List.651;
let List.684 : List Str = lowlevel ListWithCapacity #Attr.2;
ret List.684;
procedure List.71 (#Attr.2, #Attr.3):
let List.650 : List Str = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.650;
procedure List.96 (#Derived_gen.0, #Derived_gen.1, #Derived_gen.2, #Derived_gen.3, #Derived_gen.4):
joinpoint List.640 List.170 List.171 List.172 List.173 List.174:
let List.642 : Int1 = CallByName Num.22 List.173 List.174;
if List.642 then
let List.646 : Str = CallByName List.66 List.170 List.173;
inc List.646;
let List.175 : List Str = CallByName List.279 List.171 List.646 List.172;
dec List.646;
let List.645 : U64 = 1i64;
let List.644 : U64 = CallByName Num.51 List.173 List.645;
jump List.640 List.170 List.175 List.172 List.644 List.174;
else
dec List.170;
ret List.171;
in
inc #Derived_gen.0;
jump List.640 #Derived_gen.0 #Derived_gen.1 #Derived_gen.2 #Derived_gen.3 #Derived_gen.4;
let List.683 : List Str = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.683;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.282 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,65 +1,65 @@
procedure List.18 (List.167, List.168, List.169):
let List.638 : U64 = 0i64;
let List.639 : U64 = CallByName List.6 List.167;
let List.637 : List Str = CallByName List.96 List.167 List.168 List.169 List.638 List.639;
ret List.637;
procedure List.2 (List.115, List.116):
let List.632 : U64 = CallByName List.6 List.115;
let List.628 : Int1 = CallByName Num.22 List.116 List.632;
if List.628 then
let List.630 : Str = CallByName List.66 List.115 List.116;
inc List.630;
let List.629 : [C {}, C Str] = TagId(1) List.630;
ret List.629;
else
let List.627 : {} = Struct {};
let List.626 : [C {}, C Str] = TagId(0) List.627;
ret List.626;
procedure List.279 (List.280, List.281, List.277):
let List.649 : Str = CallByName Test.3 List.281;
let List.648 : List Str = CallByName List.71 List.280 List.649;
ret List.648;
procedure List.5 (List.276, List.277):
let List.278 : U64 = CallByName List.6 List.276;
let List.635 : List Str = CallByName List.68 List.278;
let List.634 : List Str = CallByName List.18 List.276 List.635 List.277;
ret List.634;
procedure List.6 (#Attr.2):
let List.633 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.633;
procedure List.66 (#Attr.2, #Attr.3):
let List.631 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.631;
procedure List.68 (#Attr.2):
let List.651 : List Str = lowlevel ListWithCapacity #Attr.2;
ret List.651;
procedure List.71 (#Attr.2, #Attr.3):
let List.650 : List Str = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.650;
procedure List.96 (#Derived_gen.0, #Derived_gen.1, #Derived_gen.2, #Derived_gen.3, #Derived_gen.4):
joinpoint List.640 List.170 List.171 List.172 List.173 List.174:
let List.642 : Int1 = CallByName Num.22 List.173 List.174;
if List.642 then
let List.646 : Str = CallByName List.66 List.170 List.173;
inc List.646;
let List.175 : List Str = CallByName List.279 List.171 List.646 List.172;
let List.645 : U64 = 1i64;
let List.644 : U64 = CallByName Num.51 List.173 List.645;
jump List.640 List.170 List.175 List.172 List.644 List.174;
procedure List.100 (#Derived_gen.0, #Derived_gen.1, #Derived_gen.2, #Derived_gen.3, #Derived_gen.4):
joinpoint List.673 List.174 List.175 List.176 List.177 List.178:
let List.675 : Int1 = CallByName Num.22 List.177 List.178;
if List.675 then
let List.679 : Str = CallByName List.66 List.174 List.177;
inc List.679;
let List.179 : List Str = CallByName List.283 List.175 List.679 List.176;
let List.678 : U64 = 1i64;
let List.677 : U64 = CallByName Num.51 List.177 List.678;
jump List.673 List.174 List.179 List.176 List.677 List.178;
else
dec List.170;
ret List.171;
dec List.174;
ret List.175;
in
inc #Derived_gen.0;
jump List.640 #Derived_gen.0 #Derived_gen.1 #Derived_gen.2 #Derived_gen.3 #Derived_gen.4;
jump List.673 #Derived_gen.0 #Derived_gen.1 #Derived_gen.2 #Derived_gen.3 #Derived_gen.4;
procedure List.18 (List.171, List.172, List.173):
let List.671 : U64 = 0i64;
let List.672 : U64 = CallByName List.6 List.171;
let List.670 : List Str = CallByName List.100 List.171 List.172 List.173 List.671 List.672;
ret List.670;
procedure List.2 (List.119, List.120):
let List.665 : U64 = CallByName List.6 List.119;
let List.661 : Int1 = CallByName Num.22 List.120 List.665;
if List.661 then
let List.663 : Str = CallByName List.66 List.119 List.120;
inc List.663;
let List.662 : [C {}, C Str] = TagId(1) List.663;
ret List.662;
else
let List.660 : {} = Struct {};
let List.659 : [C {}, C Str] = TagId(0) List.660;
ret List.659;
procedure List.283 (List.284, List.285, List.281):
let List.682 : Str = CallByName Test.3 List.285;
let List.681 : List Str = CallByName List.71 List.284 List.682;
ret List.681;
procedure List.5 (List.280, List.281):
let List.282 : U64 = CallByName List.6 List.280;
let List.668 : List Str = CallByName List.68 List.282;
let List.667 : List Str = CallByName List.18 List.280 List.668 List.281;
ret List.667;
procedure List.6 (#Attr.2):
let List.666 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.666;
procedure List.66 (#Attr.2, #Attr.3):
let List.664 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.664;
procedure List.68 (#Attr.2):
let List.684 : List Str = lowlevel ListWithCapacity #Attr.2;
ret List.684;
procedure List.71 (#Attr.2, #Attr.3):
let List.683 : List Str = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.683;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.282 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,66 +1,66 @@
procedure List.18 (List.167, List.168, List.169):
let List.630 : U64 = 0i64;
let List.631 : U64 = CallByName List.6 List.167;
let List.629 : List U8 = CallByName List.96 List.167 List.168 List.169 List.630 List.631;
ret List.629;
procedure List.279 (List.280, List.281, List.277):
let List.645 : U8 = GetTagId List.277;
joinpoint List.646 List.643:
let List.642 : List U8 = CallByName List.71 List.280 List.643;
ret List.642;
in
switch List.645:
case 0:
let List.647 : U8 = CallByName Test.4 List.281 List.277;
jump List.646 List.647;
case 1:
let List.647 : U8 = CallByName Test.6 List.281 List.277;
jump List.646 List.647;
default:
let List.647 : U8 = CallByName Test.8 List.281;
jump List.646 List.647;
procedure List.5 (List.276, List.277):
let List.278 : U64 = CallByName List.6 List.276;
let List.627 : List U8 = CallByName List.68 List.278;
let List.626 : List U8 = CallByName List.18 List.276 List.627 List.277;
ret List.626;
procedure List.6 (#Attr.2):
let List.640 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.640;
procedure List.66 (#Attr.2, #Attr.3):
let List.639 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.639;
procedure List.68 (#Attr.2):
let List.648 : List U8 = lowlevel ListWithCapacity #Attr.2;
ret List.648;
procedure List.71 (#Attr.2, #Attr.3):
let List.644 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.644;
procedure List.96 (#Derived_gen.3, #Derived_gen.4, #Derived_gen.5, #Derived_gen.6, #Derived_gen.7):
joinpoint List.632 List.170 List.171 List.172 List.173 List.174:
let List.634 : Int1 = CallByName Num.22 List.173 List.174;
if List.634 then
let List.638 : U8 = CallByName List.66 List.170 List.173;
let List.175 : List U8 = CallByName List.279 List.171 List.638 List.172;
let List.637 : U64 = 1i64;
let List.636 : U64 = CallByName Num.51 List.173 List.637;
jump List.632 List.170 List.175 List.172 List.636 List.174;
procedure List.100 (#Derived_gen.3, #Derived_gen.4, #Derived_gen.5, #Derived_gen.6, #Derived_gen.7):
joinpoint List.665 List.174 List.175 List.176 List.177 List.178:
let List.667 : Int1 = CallByName Num.22 List.177 List.178;
if List.667 then
let List.671 : U8 = CallByName List.66 List.174 List.177;
let List.179 : List U8 = CallByName List.283 List.175 List.671 List.176;
let List.670 : U64 = 1i64;
let List.669 : U64 = CallByName Num.51 List.177 List.670;
jump List.665 List.174 List.179 List.176 List.669 List.178;
else
dec List.170;
ret List.171;
dec List.174;
ret List.175;
in
inc #Derived_gen.3;
jump List.632 #Derived_gen.3 #Derived_gen.4 #Derived_gen.5 #Derived_gen.6 #Derived_gen.7;
jump List.665 #Derived_gen.3 #Derived_gen.4 #Derived_gen.5 #Derived_gen.6 #Derived_gen.7;
procedure List.18 (List.171, List.172, List.173):
let List.663 : U64 = 0i64;
let List.664 : U64 = CallByName List.6 List.171;
let List.662 : List U8 = CallByName List.100 List.171 List.172 List.173 List.663 List.664;
ret List.662;
procedure List.283 (List.284, List.285, List.281):
let List.678 : U8 = GetTagId List.281;
joinpoint List.679 List.676:
let List.675 : List U8 = CallByName List.71 List.284 List.676;
ret List.675;
in
switch List.678:
case 0:
let List.680 : U8 = CallByName Test.4 List.285 List.281;
jump List.679 List.680;
case 1:
let List.680 : U8 = CallByName Test.6 List.285 List.281;
jump List.679 List.680;
default:
let List.680 : U8 = CallByName Test.8 List.285;
jump List.679 List.680;
procedure List.5 (List.280, List.281):
let List.282 : U64 = CallByName List.6 List.280;
let List.660 : List U8 = CallByName List.68 List.282;
let List.659 : List U8 = CallByName List.18 List.280 List.660 List.281;
ret List.659;
procedure List.6 (#Attr.2):
let List.673 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.673;
procedure List.66 (#Attr.2, #Attr.3):
let List.672 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.672;
procedure List.68 (#Attr.2):
let List.681 : List U8 = lowlevel ListWithCapacity #Attr.2;
ret List.681;
procedure List.71 (#Attr.2, #Attr.3):
let List.677 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.677;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.283 : U8 = lowlevel NumAdd #Attr.2 #Attr.3;

View file

@ -1,25 +1,25 @@
procedure List.3 (List.123, List.124, List.125):
let List.627 : {List I64, I64} = CallByName List.64 List.123 List.124 List.125;
let List.626 : List I64 = StructAtIndex 0 List.627;
ret List.626;
procedure List.3 (List.127, List.128, List.129):
let List.660 : {List I64, I64} = CallByName List.64 List.127 List.128 List.129;
let List.659 : List I64 = StructAtIndex 0 List.660;
ret List.659;
procedure List.6 (#Attr.2):
let List.633 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.633;
let List.666 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.666;
procedure List.64 (List.120, List.121, List.122):
let List.632 : U64 = CallByName List.6 List.120;
let List.629 : Int1 = CallByName Num.22 List.121 List.632;
if List.629 then
let List.630 : {List I64, I64} = CallByName List.67 List.120 List.121 List.122;
ret List.630;
procedure List.64 (List.124, List.125, List.126):
let List.665 : U64 = CallByName List.6 List.124;
let List.662 : Int1 = CallByName Num.22 List.125 List.665;
if List.662 then
let List.663 : {List I64, I64} = CallByName List.67 List.124 List.125 List.126;
ret List.663;
else
let List.628 : {List I64, I64} = Struct {List.120, List.122};
ret List.628;
let List.661 : {List I64, I64} = Struct {List.124, List.126};
ret List.661;
procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
let List.631 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.631;
let List.664 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.664;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.281 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,11 +1,11 @@
procedure List.28 (#Attr.2, #Attr.3):
let List.628 : List I64 = lowlevel ListSortWith { xs: `#Attr.#arg1` } #Attr.2 Num.46 #Attr.3;
ret List.628;
let List.661 : List I64 = lowlevel ListSortWith { xs: `#Attr.#arg1` } #Attr.2 Num.46 #Attr.3;
ret List.661;
procedure List.59 (List.382):
let List.627 : {} = Struct {};
let List.626 : List I64 = CallByName List.28 List.382 List.627;
ret List.626;
procedure List.59 (List.386):
let List.660 : {} = Struct {};
let List.659 : List I64 = CallByName List.28 List.386 List.660;
ret List.659;
procedure Num.46 (#Attr.2, #Attr.3):
let Num.281 : U8 = lowlevel NumCompare #Attr.2 #Attr.3;

View file

@ -1,41 +1,41 @@
procedure List.2 (List.115, List.116):
let List.648 : U64 = CallByName List.6 List.115;
let List.645 : Int1 = CallByName Num.22 List.116 List.648;
if List.645 then
let List.647 : I64 = CallByName List.66 List.115 List.116;
let List.646 : [C {}, C I64] = TagId(1) List.647;
ret List.646;
procedure List.2 (List.119, List.120):
let List.681 : U64 = CallByName List.6 List.119;
let List.678 : Int1 = CallByName Num.22 List.120 List.681;
if List.678 then
let List.680 : I64 = CallByName List.66 List.119 List.120;
let List.679 : [C {}, C I64] = TagId(1) List.680;
ret List.679;
else
let List.644 : {} = Struct {};
let List.643 : [C {}, C I64] = TagId(0) List.644;
ret List.643;
let List.677 : {} = Struct {};
let List.676 : [C {}, C I64] = TagId(0) List.677;
ret List.676;
procedure List.3 (List.123, List.124, List.125):
let List.635 : {List I64, I64} = CallByName List.64 List.123 List.124 List.125;
let List.634 : List I64 = StructAtIndex 0 List.635;
ret List.634;
procedure List.3 (List.127, List.128, List.129):
let List.668 : {List I64, I64} = CallByName List.64 List.127 List.128 List.129;
let List.667 : List I64 = StructAtIndex 0 List.668;
ret List.667;
procedure List.6 (#Attr.2):
let List.633 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.633;
let List.666 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.666;
procedure List.64 (List.120, List.121, List.122):
let List.632 : U64 = CallByName List.6 List.120;
let List.629 : Int1 = CallByName Num.22 List.121 List.632;
if List.629 then
let List.630 : {List I64, I64} = CallByName List.67 List.120 List.121 List.122;
ret List.630;
procedure List.64 (List.124, List.125, List.126):
let List.665 : U64 = CallByName List.6 List.124;
let List.662 : Int1 = CallByName Num.22 List.125 List.665;
if List.662 then
let List.663 : {List I64, I64} = CallByName List.67 List.124 List.125 List.126;
ret List.663;
else
let List.628 : {List I64, I64} = Struct {List.120, List.122};
ret List.628;
let List.661 : {List I64, I64} = Struct {List.124, List.126};
ret List.661;
procedure List.66 (#Attr.2, #Attr.3):
let List.641 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.641;
let List.674 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.674;
procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
let List.631 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.631;
let List.664 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.664;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.283 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,25 +1,25 @@
procedure List.3 (List.123, List.124, List.125):
let List.635 : {List U64, U64} = CallByName List.64 List.123 List.124 List.125;
let List.634 : List U64 = StructAtIndex 0 List.635;
ret List.634;
procedure List.3 (List.127, List.128, List.129):
let List.668 : {List U64, U64} = CallByName List.64 List.127 List.128 List.129;
let List.667 : List U64 = StructAtIndex 0 List.668;
ret List.667;
procedure List.6 (#Attr.2):
let List.633 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.633;
let List.666 : U64 = lowlevel ListLenU64 #Attr.2;
ret List.666;
procedure List.64 (List.120, List.121, List.122):
let List.632 : U64 = CallByName List.6 List.120;
let List.629 : Int1 = CallByName Num.22 List.121 List.632;
if List.629 then
let List.630 : {List U64, U64} = CallByName List.67 List.120 List.121 List.122;
ret List.630;
procedure List.64 (List.124, List.125, List.126):
let List.665 : U64 = CallByName List.6 List.124;
let List.662 : Int1 = CallByName Num.22 List.125 List.665;
if List.662 then
let List.663 : {List U64, U64} = CallByName List.67 List.124 List.125 List.126;
ret List.663;
else
let List.628 : {List U64, U64} = Struct {List.120, List.122};
ret List.628;
let List.661 : {List U64, U64} = Struct {List.124, List.126};
ret List.661;
procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
let List.631 : {List U64, U64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.631;
let List.664 : {List U64, U64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.664;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.281 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

Some files were not shown because too many files have changed in this diff Show more