hv1: early-exit at main (no plugin init); tokenizer: Stage-3 single-quote + full escapes (\/ \b \f \' \r fix); builder: route BinOp via SSOT emit_binop_to_dst; hv1 verify canary route (builder→Core); docs: phase-20.39 updates

This commit is contained in:
nyash-codex
2025-11-04 20:46:43 +09:00
parent 31ce798341
commit 44a5158a14
53 changed files with 2237 additions and 179 deletions

View File

@ -9,6 +9,25 @@ use nyash_rust::runner::NyashRunner;
/// Thin entry point - delegates to CLI parsing and runner execution
fn main() {
// hv1 direct (primary): earliest possible check before any bootstrap/log init
// If NYASH_VERIFY_JSON is present and route is requested, execute and exit.
// This avoids plugin host/registry initialization and keeps output minimal.
let has_json = std::env::var("NYASH_VERIFY_JSON").is_ok();
let route = std::env::var("HAKO_ROUTE_HAKOVM").ok().as_deref() == Some("1")
|| std::env::var("HAKO_VERIFY_PRIMARY").ok().as_deref() == Some("hakovm");
if has_json && route {
let json = std::env::var("NYASH_VERIFY_JSON").unwrap_or_default();
// Minimal runner (no plugin init here); config parse is cheap and has no side effects.
let cfg = CliConfig::parse();
let runner = NyashRunner::new(cfg);
if std::env::var("NYASH_CLI_VERBOSE").ok().as_deref() == Some("1") {
eprintln!("[hv1-direct] early-exit (main)");
}
let rc = nyash_rust::runner::core_executor::run_json_v0(&runner, &json);
println!("{}", rc);
std::process::exit(rc);
}
// Bootstrap env overrides from nyash.toml [env] early (管理棟)
env_config::bootstrap_from_toml_env();
// Parse command-line arguments