- Created 4 representative test cases for Pattern3 patterns: * test_pattern3_if_phi_no_break.hako - Core Pattern3 (if-else PHI, no break/continue) * test_pattern3_skip_whitespace.hako - Pattern3+break style (routed to Pattern2) * test_pattern3_trim_leading.hako - Pattern3+break style (routed to Pattern2) * test_pattern3_trim_trailing.hako - Pattern3+break style (routed to Pattern2) - Validated Pattern3_WithIfPhi detection: * Pattern routing: Pattern3_WithIfPhi MATCHED confirmed * JoinIR lowering: 3 functions, 20 blocks → 8 blocks (successful) * [joinir/freeze] elimination: Complete (no errors on any test) - Clarified pattern classification: * Pattern3_WithIfPhi handles if-else PHI without break/continue * Loops with "if-else PHI + break" are routed to Pattern2_WithBreak * Break takes priority over if-else PHI in pattern detection - Cumulative achievement (Phase 162-164): * Pattern1: 6 loops working ✅ * Pattern2: 5 loops working ✅ * Pattern3 (no break): 1 loop working ✅ * Pattern3+break (as Pattern2): 3 loops working ✅ * Total: 15 loops covered, zero [joinir/freeze] errors - Updated CURRENT_TASK.md with Phase 164 section and findings Next: Phase 165 Pattern4 (continue) validation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
36 lines
803 B
Plaintext
36 lines
803 B
Plaintext
// Phase 162: Test BundleResolver merge loop (Pattern1 simple)
|
|
// Target: BundleResolver merge loops (L107, L111) - Pattern1 (Simple)
|
|
|
|
static box Main {
|
|
main(args) {
|
|
// Simulate BundleResolver merge logic
|
|
local merged = ""
|
|
|
|
// Simulate bundle_srcs (first array)
|
|
local srcs = new ArrayBox()
|
|
srcs.push("// code1")
|
|
srcs.push("// code2")
|
|
|
|
local i = 0
|
|
local m = srcs.length()
|
|
loop(i < m) {
|
|
merged = merged + srcs.get(i) + "\n"
|
|
i = i + 1
|
|
}
|
|
|
|
// Simulate bundle_mod_srcs (second array)
|
|
local mods = new ArrayBox()
|
|
mods.push("// code3")
|
|
|
|
local i2 = 0
|
|
local m2 = mods.length()
|
|
loop(i2 < m2) {
|
|
merged = merged + mods.get(i2) + "\n"
|
|
i2 = i2 + 1
|
|
}
|
|
|
|
print("Merged length: " + ("" + merged.length()))
|
|
return 0
|
|
}
|
|
}
|