Runner: canonicalize json-file input via core_bridge when HAKO_NYVM_CORE=1

This commit is contained in:
nyash-codex
2025-11-01 05:19:10 +09:00
parent 4f4ee948e0
commit cac22c1a87
3 changed files with 32 additions and 1 deletions

View File

@ -19,7 +19,7 @@ impl NyashRunner {
if !(groups.parser.ny_parser_pipe || groups.parser.json_file.is_some()) {
return false;
}
let json = if let Some(path) = &groups.parser.json_file {
let mut json = if let Some(path) = &groups.parser.json_file {
match std::fs::read_to_string(path) {
Ok(s) => s,
Err(e) => {
@ -36,6 +36,12 @@ impl NyashRunner {
}
buf
};
if crate::config::env::nyvm_core_wrapper() {
match crate::runner::modes::common_util::core_bridge::canonicalize_module_json(&json) {
Ok(j) => json = j,
Err(e) => eprintln!("[bridge] canonicalize warning: {}", e),
}
}
match super::json_v0_bridge::parse_json_v0_to_module(&json) {
Ok(module) => {
// Optional dump via env verbose