sim_lib_lang_lua/
profile.rs1use sim_kernel::{Cx, Result, Symbol};
2use sim_lib_standard_core::{
3 LanguageProfile, OrganUse, ProfileRegistry, fidelity_badge, install_language_profile,
4};
5
6use crate::{
7 lua_conformance_test_symbol, lua_control_fidelity_symbol, lua_full_runtime_fidelity_symbol,
8 lua_lowering_symbol, lua_mutation_fidelity_symbol, lua_profile_symbol, lua_reader_symbol,
9};
10
11pub fn lua_core_profile() -> LanguageProfile {
18 let profile = lua_profile_symbol();
19 let test = lua_conformance_test_symbol();
20 LanguageProfile::new(profile.clone())
21 .with_reader(lua_reader_symbol())
22 .with_lowering(lua_lowering_symbol())
23 .with_eval_policy(Symbol::qualified("eval", "lua-core"))
24 .with_organ(OrganUse::new(sim_lib_control::control_organ_symbol()))
25 .with_organ(OrganUse::new(sim_lib_mutation::mutation_organ_symbol()))
26 .requiring(sim_lib_mutation::standard_mutate_capability())
27 .with_unsupported_form(Symbol::qualified("lua", "full-vm-debug-hooks"))
28 .with_conformance_test(test.clone())
29 .with_fidelity_badge(fidelity_badge(
30 &profile,
31 lua_control_fidelity_symbol(),
32 1,
33 &test,
34 ))
35 .with_fidelity_badge(fidelity_badge(
36 &profile,
37 lua_mutation_fidelity_symbol(),
38 1,
39 &test,
40 ))
41 .with_fidelity_badge(fidelity_badge(
42 &profile,
43 lua_full_runtime_fidelity_symbol(),
44 0,
45 &test,
46 ))
47}
48
49pub fn install_lua_core_profile(
69 cx: &mut Cx,
70 registry: &mut ProfileRegistry,
71) -> Result<LanguageProfile> {
72 install_language_profile(
73 cx,
74 registry,
75 lua_core_profile(),
76 &[
77 sim_lib_control::publish_control_organ_claims_for_lib,
78 sim_lib_mutation::publish_mutation_organ_claims_for_lib,
79 ],
80 )
81}