Files
hakorune/apps/tests/phase256_p0_split_min.hako
tomoaki 64f679354a fix(joinir): Phase 256 P1 - Carrier PHI wiring and parameter mapping (in progress)
**Status**: Core carrier PHI issue partially resolved, debugging loop body

**Progress**:
 Task 1: split_scan_minimal.rs Carriers-First ordering (6 locations)
 Task 2: pattern7_split_scan.rs boundary configuration (host/join inputs, exit_bindings, expr_result)
 Result now flows from k_exit to post-loop code (RC issue resolved)
⚠️  Loop body instruction execution needs review

**Key Fixes**:
1. Fixed host_inputs/join_inputs to match main() params Carriers-First order
2. Added result to exit_bindings (CarrierRole::LoopState)
3. Added result back to loop_invariants for variable initialization
4. Added expr_result=join_exit_value_result for loop expression return
5. Fixed jump args to k_exit to include all 4 params [i, start, result, s]

**Current Issue**:
- Loop body type errors resolved (String vs Integer fixed)
- New issue: Loop body computations (sep_len) undefined in certain blocks
- Likely cause: JoinIR→MIR conversion of local variables needs review

**Next Steps**:
- Review JoinValueSpace allocation and ValueId mapping in conversion
- Verify loop_step instruction ordering and block structure
- May need to refactor bound computation or revisit split algorithm

🤖 Generated with Claude Code
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2025-12-20 01:24:04 +09:00

38 lines
916 B
Plaintext

// Phase 256 P0: Minimal split test fixture
// Tests: split("a,b,c", ",") → ["a","b","c"] → length = 3
static box StringUtils {
split(s, separator) {
local result = new ArrayBox()
if separator.length() == 0 {
result.push(s)
return result
}
local start = 0
local i = 0
loop(i <= s.length() - separator.length()) {
if s.substring(i, i + separator.length()) == separator {
result.push(s.substring(start, i))
start = i + separator.length()
i = start
} else {
i = i + 1
}
}
if start <= s.length() {
result.push(s.substring(start, s.length()))
}
return result
}
}
static box Main {
main() {
local result = StringUtils.split("a,b,c", ",")
return result.length()
}
}