json(vm): fix birth dispatch; unify constructor naming (Box.birth/N); JsonNode factories return JsonNodeInstance; quick: enable heavy JSON with probe; builder: NYASH_BUILDER_DEBUG_LIMIT guard; json_query_min(core) harness; docs/tasks updated
This commit is contained in:
@ -11,6 +11,20 @@ impl MirInterpreter {
|
||||
|
||||
pub(super) fn handle_print(&mut self, value: ValueId) -> Result<(), VMError> {
|
||||
let v = self.reg_load(value)?;
|
||||
// Align with calls.rs behavior: Void/BoxRef(VoidBox) prints as null; raw String/StringBox unquoted
|
||||
match &v {
|
||||
VMValue::Void => { println!("null"); return Ok(()); }
|
||||
VMValue::BoxRef(bx) => {
|
||||
if bx.as_any().downcast_ref::<crate::box_trait::VoidBox>().is_some() {
|
||||
println!("null"); return Ok(());
|
||||
}
|
||||
if let Some(sb) = bx.as_any().downcast_ref::<crate::box_trait::StringBox>() {
|
||||
println!("{}", sb.value); return Ok(());
|
||||
}
|
||||
}
|
||||
VMValue::String(s) => { println!("{}", s); return Ok(()); }
|
||||
_ => {}
|
||||
}
|
||||
println!("{}", v.to_string());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user