- Fixed ValueId collision between body-local and carrier params - Added ExitLine contract verifier (debug assertions) - Updated test files to use Main box - E2E verified: atoi→12, parse_number→123 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
33 lines
875 B
Plaintext
33 lines
875 B
Plaintext
// Phase 190: Number accumulation test - atoi implementation
|
|
// Tests: result = result * 10 + i pattern (direct loop variable usage)
|
|
// Uses Pattern 2 (break) to enable carrier support
|
|
//
|
|
// Note: Phase 190-impl-D found that body-local variable support is incomplete.
|
|
// Using loop variable directly for now.
|
|
//
|
|
// Expected calculation:
|
|
// i=0: result = 0*10 + 0 = 0
|
|
// i=1: result = 0*10 + 1 = 1
|
|
// i=2: result = 1*10 + 2 = 12
|
|
// i=3: break (condition i >= 3)
|
|
// Expected result: 12
|
|
|
|
static box Main {
|
|
main() {
|
|
local result
|
|
result = 0
|
|
local i
|
|
i = 0
|
|
loop(i < 10) {
|
|
if i >= 3 {
|
|
break
|
|
}
|
|
// Phase 190-impl-D: Use loop variable directly instead of body-local
|
|
result = result * 10 + i
|
|
i = i + 1
|
|
}
|
|
print(result)
|
|
return 0
|
|
}
|
|
}
|