Files
hakorune/src/tests/mir_funcscanner_skip_ws_min.rs
nyash-codex e656958033 feat(env): Phase 71-73 - SSA fix + Stage-3 ENV consolidation
## Phase 71-SSA: StageBDriverBox birth warning 解消
- Fixed false-positive dev verify warning for static boxes
- StageBDriverBox is a static box, so it doesn't follow NewBox→birth pattern
- Modified lifecycle.rs to skip StageBDriverBox from birth() requirement

## Phase 73-A: Stage-3 legacy ENV 統一化
- Consolidated NYASH_PARSER_STAGE3 and HAKO_PARSER_STAGE3 → NYASH_FEATURES=stage3
- Updated 20 test files (46 direct replacements)
- Special handling for parser_stage3.rs compat layer and mir_static_main_args_loop.rs
- All test files now use unified NYASH_FEATURES=stage3

## Phase 72-73: ENV inventory documented
- Created phase72-73-env-inventory.md with complete usage analysis
- Identified 113 direct ENV reads requiring SSOT consolidation
- Prioritized Phase 72 (JoinIR EXPERIMENT SSOT) and Phase 73 (Stage-3 cleanup)

## Phase 74-SSA: Minimal reproduction for static box delegation
- Created parser_box_minimal.hako and ssa_static_delegation_min.hako
- Investigated spawn failure in selfhost compiler (arguments too long)
- Root cause: NYASH_NY_COMPILER_EMIT_ONLY=1 defaults to emit-only mode

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 12:36:28 +09:00

41 lines
1.5 KiB
Rust

// Smallest repro for skip_whitespace SSA/PHI issues
// Inputs: lang/src/compiler/tests/funcscanner_skip_ws_min.hako
// Goal: verify + VM execute without undefined ValueId
use crate::ast::ASTNode;
use crate::mir::{MirCompiler, MirVerifier};
use crate::parser::NyashParser;
#[test]
fn mir_funcscanner_skip_ws_min_verify_and_vm() {
let test_file = "lang/src/compiler/tests/funcscanner_skip_ws_min.hako";
// Stage-3 + using
std::env::set_var("NYASH_FEATURES", "stage3");
std::env::set_var("NYASH_FEATURES", "stage3");
std::env::set_var("NYASH_ENABLE_USING", "1");
std::env::set_var("HAKO_ENABLE_USING", "1");
std::env::set_var("NYASH_DISABLE_PLUGINS", "1");
let src = std::fs::read_to_string(test_file).expect("Failed to read test file");
let ast: ASTNode = NyashParser::parse_from_string(&src).expect("parse failed");
let mut mc = MirCompiler::with_options(false);
let compiled = mc.compile(ast).expect("compile failed");
let mut verifier = MirVerifier::new();
if let Err(errors) = verifier.verify_module(&compiled.module) {
panic!("MIR verify failed: {:?}", errors);
}
use crate::backend::VM;
let mut vm = VM::new();
vm.execute_module(&compiled.module).expect("VM exec failed");
std::env::remove_var("NYASH_FEATURES");
std::env::remove_var("NYASH_FEATURES");
std::env::remove_var("NYASH_ENABLE_USING");
std::env::remove_var("HAKO_ENABLE_USING");
std::env::remove_var("NYASH_DISABLE_PLUGINS");
}