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>
This commit is contained in:
@ -387,8 +387,9 @@ impl super::MirBuilder {
|
||||
args,
|
||||
} = &insns[idx]
|
||||
{
|
||||
// Stage‑B dev verify OFF のときは StageBDriverBox の birth 警告のみスキップ
|
||||
if !stageb_dev_verify_on && box_type == "StageBDriverBox" {
|
||||
// Phase 71-SSA 71-11.2: StageBDriverBox is a static box → skip birth warning unconditionally
|
||||
// Static boxes don't follow NewBox→birth pattern by design
|
||||
if box_type == "StageBDriverBox" {
|
||||
idx += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -25,8 +25,8 @@ use crate::mir::MirCompiler;
|
||||
use crate::parser::NyashParser;
|
||||
|
||||
fn ensure_stage3_env() {
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("HAKO_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_PARSER_ALLOW_SEMICOLON", "1");
|
||||
std::env::set_var("NYASH_DISABLE_PLUGINS", "1");
|
||||
std::env::set_var("HAKO_MIR_BUILDER_METHODIZE", "0");
|
||||
@ -100,8 +100,8 @@ static box Main {
|
||||
}
|
||||
|
||||
// cleanup
|
||||
std::env::remove_var("NYASH_PARSER_STAGE3");
|
||||
std::env::remove_var("HAKO_PARSER_STAGE3");
|
||||
std::env::remove_var("NYASH_FEATURES");
|
||||
std::env::remove_var("NYASH_FEATURES");
|
||||
std::env::remove_var("NYASH_PARSER_ALLOW_SEMICOLON");
|
||||
std::env::remove_var("NYASH_DISABLE_PLUGINS");
|
||||
std::env::remove_var("HAKO_MIR_BUILDER_METHODIZE");
|
||||
|
||||
@ -18,7 +18,7 @@ use crate::mir::{MirCompiler, MirPrinter, MirVerifier};
|
||||
use crate::parser::NyashParser;
|
||||
|
||||
fn ensure_stage3_env() {
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_PARSER_ALLOW_SEMICOLON", "1");
|
||||
}
|
||||
|
||||
|
||||
@ -22,8 +22,8 @@ mod tests {
|
||||
#[test]
|
||||
fn vm_exec_continue_skips_body() {
|
||||
// Phase 59b: Stage-3 parser required for local variable declarations
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("HAKO_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
|
||||
let code = r#"
|
||||
local i = 0
|
||||
@ -46,8 +46,8 @@ mod tests {
|
||||
#[test]
|
||||
fn vm_exec_break_inside_if() {
|
||||
// Phase 59b: Stage-3 parser required for local variable declarations
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("HAKO_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
|
||||
let code = r#"
|
||||
local i = 0
|
||||
|
||||
@ -17,8 +17,8 @@ fn mir_funcscanner_parse_params_trim_min_verify_and_vm() {
|
||||
let test_file = "lang/src/compiler/tests/funcscanner_parse_params_trim_min.hako";
|
||||
|
||||
// Align parser env to Stage‑3 + using 経路(既存の skip_ws 系と揃えておく)。
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("HAKO_PARSER_STAGE3", "1");
|
||||
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_PARSER_ALLOW_SEMICOLON", "1");
|
||||
@ -92,8 +92,8 @@ fn mir_funcscanner_parse_params_trim_min_verify_and_vm() {
|
||||
);
|
||||
|
||||
// Cleanup env vars
|
||||
std::env::remove_var("NYASH_PARSER_STAGE3");
|
||||
std::env::remove_var("HAKO_PARSER_STAGE3");
|
||||
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_PARSER_ALLOW_SEMICOLON");
|
||||
|
||||
@ -16,8 +16,8 @@ fn mir_funcscanner_skip_ws_direct_vm() {
|
||||
let test_file = "lang/src/compiler/tests/funcscanner_skip_ws_min.hako";
|
||||
|
||||
// Enable required env vars for Stage-3 + using
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("HAKO_PARSER_STAGE3", "1");
|
||||
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_PARSER_ALLOW_SEMICOLON", "1");
|
||||
@ -118,8 +118,8 @@ fn mir_funcscanner_skip_ws_direct_vm() {
|
||||
}
|
||||
|
||||
// Cleanup env vars
|
||||
std::env::remove_var("NYASH_PARSER_STAGE3");
|
||||
std::env::remove_var("HAKO_PARSER_STAGE3");
|
||||
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_PARSER_ALLOW_SEMICOLON");
|
||||
|
||||
@ -11,8 +11,8 @@ 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_PARSER_STAGE3", "1");
|
||||
std::env::set_var("HAKO_PARSER_STAGE3", "1");
|
||||
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");
|
||||
@ -32,8 +32,8 @@ fn mir_funcscanner_skip_ws_min_verify_and_vm() {
|
||||
let mut vm = VM::new();
|
||||
vm.execute_module(&compiled.module).expect("VM exec failed");
|
||||
|
||||
std::env::remove_var("NYASH_PARSER_STAGE3");
|
||||
std::env::remove_var("HAKO_PARSER_STAGE3");
|
||||
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");
|
||||
|
||||
@ -19,7 +19,7 @@ use crate::mir::{MirCompiler, MirPrinter, MirVerifier};
|
||||
use crate::parser::NyashParser;
|
||||
|
||||
fn ensure_stage3_env() {
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_PARSER_ALLOW_SEMICOLON", "1");
|
||||
std::env::set_var("NYASH_ENABLE_USING", "1");
|
||||
}
|
||||
|
||||
@ -16,8 +16,8 @@ fn mir_funcscanner_trim_min_verify_and_vm() {
|
||||
let test_file = "lang/src/compiler/tests/funcscanner_trim_min.hako";
|
||||
|
||||
// Stage‑3 + using 系のパーサ設定を揃える(他の FuncScanner 系テストと同じ)。
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("HAKO_PARSER_STAGE3", "1");
|
||||
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_PARSER_ALLOW_SEMICOLON", "1");
|
||||
@ -87,8 +87,8 @@ fn mir_funcscanner_trim_min_verify_and_vm() {
|
||||
}
|
||||
|
||||
// Cleanup env vars
|
||||
std::env::remove_var("NYASH_PARSER_STAGE3");
|
||||
std::env::remove_var("HAKO_PARSER_STAGE3");
|
||||
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_PARSER_ALLOW_SEMICOLON");
|
||||
|
||||
@ -12,7 +12,7 @@ use crate::parser::NyashParser;
|
||||
|
||||
#[test]
|
||||
fn mir_locals_copy_instructions_emitted() {
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_PARSER_ALLOW_SEMICOLON", "1");
|
||||
|
||||
let src = r#"
|
||||
@ -102,7 +102,7 @@ static box TestLocals {
|
||||
|
||||
#[test]
|
||||
fn mir_locals_uninitialized() {
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_PARSER_ALLOW_SEMICOLON", "1");
|
||||
|
||||
let src = r#"
|
||||
|
||||
@ -31,7 +31,7 @@ return (new StringBox("Hello")).length()
|
||||
/// Minimal smoke for MirInstruction::DebugLog
|
||||
#[test]
|
||||
fn mir_debuglog_minimal_printer_and_verifier() {
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_PARSER_ALLOW_SEMICOLON", "1");
|
||||
std::env::set_var("NYASH_MIR_DEBUG_LOG", "1");
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ use crate::mir::MirPrinter;
|
||||
use crate::parser::NyashParser;
|
||||
|
||||
fn ensure_stage3_env() {
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_PARSER_ALLOW_SEMICOLON", "1");
|
||||
}
|
||||
use crate::ast::ASTNode;
|
||||
|
||||
@ -3,7 +3,7 @@ use crate::mir::{MirCompiler, MirPrinter, MirVerifier};
|
||||
use crate::parser::NyashParser;
|
||||
|
||||
fn ensure_stage3_env() {
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_PARSER_ALLOW_SEMICOLON", "1");
|
||||
}
|
||||
|
||||
|
||||
@ -47,8 +47,8 @@ static box Main {
|
||||
#[test]
|
||||
fn mir_stageb_string_utils_skip_ws_compile() {
|
||||
// Enable Stage-3 parser for 'local' keyword
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("HAKO_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
|
||||
let src = make_minimal_src();
|
||||
let ast: ASTNode = NyashParser::parse_from_string(&src).expect("parse should succeed");
|
||||
@ -75,8 +75,8 @@ static box Main {
|
||||
#[ignore] // 修正前用テスト(commit b00cc8d5 で再現)
|
||||
fn mir_stageb_string_utils_skip_ws_exec_reproduce_void_lt_zero() {
|
||||
// Enable Stage-3 parser
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("HAKO_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
|
||||
let src = make_minimal_src();
|
||||
let ast: ASTNode = NyashParser::parse_from_string(&src).expect("parse ok");
|
||||
@ -113,8 +113,8 @@ static box Main {
|
||||
#[test]
|
||||
fn mir_stageb_string_utils_skip_ws_exec_success() {
|
||||
// Enable Stage-3 parser
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("HAKO_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
|
||||
let src = make_minimal_src();
|
||||
let ast: ASTNode = NyashParser::parse_from_string(&src).expect("parse ok");
|
||||
|
||||
@ -28,8 +28,8 @@ fn load_fixture_with_string_helpers() -> String {
|
||||
#[test]
|
||||
fn mir_static_main_box_emits_canonical_static_methods() {
|
||||
// Enable Stage‑3 + using for the fixture.
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("HAKO_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_PARSER_ALLOW_SEMICOLON", "1");
|
||||
std::env::set_var("NYASH_ENABLE_USING", "1");
|
||||
std::env::set_var("HAKO_ENABLE_USING", "1");
|
||||
@ -59,8 +59,8 @@ fn mir_static_main_box_emits_canonical_static_methods() {
|
||||
/// Execute the minimal fixture with Void-returning _nop() and confirm it lowers without SSA/arity drift.
|
||||
#[test]
|
||||
fn mir_static_main_box_executes_void_path_with_guard() {
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("HAKO_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_PARSER_ALLOW_SEMICOLON", "1");
|
||||
std::env::set_var("NYASH_ENABLE_USING", "1");
|
||||
std::env::set_var("HAKO_ENABLE_USING", "1");
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
use crate::parser::NyashParser;
|
||||
|
||||
fn enable_stage3() {
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
// Accept block‑postfix under Stage‑3 gate
|
||||
std::env::set_var("NYASH_BLOCK_CATCH", "1");
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
use crate::parser::NyashParser;
|
||||
|
||||
fn enable_stage3() {
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_BLOCK_CATCH", "1");
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
use crate::parser::NyashParser;
|
||||
|
||||
fn enable_stage3() {
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
use crate::parser::NyashParser;
|
||||
|
||||
fn enable_stage3() {
|
||||
std::env::set_var("NYASH_PARSER_STAGE3", "1");
|
||||
std::env::set_var("NYASH_FEATURES", "stage3");
|
||||
std::env::set_var("NYASH_METHOD_CATCH", "1");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user