feat(normalization): Phase 142 P0 - Loop statement-level normalization

Phase 142-loopstmt P0: Statement-level normalization

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

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-19 05:28:49 +09:00
parent 275fe45ba4
commit 4082abb30c
23 changed files with 1610 additions and 246 deletions

View File

@ -0,0 +1,29 @@
// Phase 139 P0: if-only post_k return add minimal fixture
//
// Purpose: Ensure post_if_post_k.rs delegates return lowering to ReturnValueLowererBox
// Pattern:
// x = 1
// flag = 1
// if flag == 1 { x = 2 } else { x = 1 }
// return x + 2
// Expected: exit code 4
//
// Notes:
// - Requires explicit else (Phase 129-C contract for post_if_post_k)
// - Dev-only Normalized shadow path (NYASH_JOINIR_DEV=1 + HAKO_JOINIR_STRICT=1)
static box Main {
main() {
local x
local flag
x = 1
flag = 1
if flag == 1 {
x = 2
} else {
x = 1
}
return x + 2
}
}

View File

@ -0,0 +1,27 @@
// Phase 141 P1: ExprLowerer known intrinsic (length0) minimal fixture (if-only)
//
// Purpose: Exercise MethodCall lowering via `ReturnValueLowererBox` without loop-boundary merge.
//
// Pattern:
// s = "abc"
// flag = 1
// if flag == 1 { s = s } else { s = s }
// return s.length()
//
// Expected: exit code 3
// Notes: Dev-only Normalized shadow path (NYASH_JOINIR_DEV=1 + HAKO_JOINIR_STRICT=1)
static box Main {
main() {
local s
local flag
s = "abc"
flag = 1
if flag == 1 {
s = s
} else {
s = s
}
return s.length()
}
}