use super::util::{self, *};
use crate::program::Program;
use crate::registry::{Sugar, YomiMap};
use crate::value::Identity;
use crate::vm::*;
fn registry() -> Registry {
ui_registry(&[Sugar::Choice], |r| {
r.stop::<(), YomiMap<String, i64>>("game.scores").unwrap();
r.stop::<(), Identity>("game.who").unwrap();
r.stop::<(YomiMap<String, i64>,), ()>("game.show").unwrap();
})
}
fn compile_ok(src: &str) -> Program {
util::compile_ok(src, ®istry())
}
fn compile_codes(src: &str) -> Vec<&'static str> {
util::error_codes(src, ®istry())
}
fn warning_codes(src: &str) -> Vec<&'static str> {
util::diag_codes(src, ®istry())
}
fn run_all(vm: &mut Vm<'_>) -> Vec<String> {
util::run_all(vm, 2000)
}
fn texts(src: &str) -> Vec<String> {
util::texts_with(src, ®istry(), VmConfig::default(), 2000)
}
fn one(body: &str) -> String {
let src = format!("label start {{\n{body}\n}}\n");
let t = texts(&src);
assert_eq!(t.last().map(String::as_str), Some("<end>"), "{t:?}");
t[..t.len() - 1].join("|")
}
mod command_returns;
mod for_pairs;
mod for_range;
mod identity;
mod limits;
mod map_exec;
mod save_load;
mod syntax_types;
mod value_semantics;