stage3: unify to cleanup; MIR return-defer; docs+smokes updated; LLVM(harness): finalize_phis ownership, ret.py simplified, uses-predeclare; cleanup return override green; method-postfix cleanup return WIP (PHI head)
This commit is contained in:
@ -439,6 +439,19 @@ impl PluginLoaderV2 {
|
||||
}
|
||||
Ok(None)
|
||||
}
|
||||
("env.result", "ok") => {
|
||||
// Wrap the first argument as Result.Ok; if missing, use Void
|
||||
let v = args.get(0).map(|b| b.clone_box()).unwrap_or_else(|| Box::new(crate::box_trait::VoidBox::new()));
|
||||
Ok(Some(Box::new(crate::boxes::result::NyashResultBox::new_ok(v))))
|
||||
}
|
||||
("env.result", "err") => {
|
||||
// Wrap the first argument as Result.Err; if missing, synthesize a StringBox("Error")
|
||||
let e: Box<dyn NyashBox> = args
|
||||
.get(0)
|
||||
.map(|b| b.clone_box())
|
||||
.unwrap_or_else(|| Box::new(crate::box_trait::StringBox::new("Error")));
|
||||
Ok(Some(Box::new(crate::boxes::result::NyashResultBox::new_err(e))))
|
||||
}
|
||||
("env.modules", "set") => {
|
||||
if args.len() >= 2 {
|
||||
let key = args[0].to_string_box().value;
|
||||
|
||||
Reference in New Issue
Block a user