Files
hakorune/apps/tests/loop_continue_pattern4.hako
nyash-codex a21501286e feat(joinir): Structural pattern detection + Pattern 4 scaffold
- Add LoopFeatures struct for structure-based detection (no name deps)
- Add LoopPatternKind enum and classify() function
- Pattern 3: has_if_else_phi && !has_break && !has_continue
- Pattern 4: has_continue == true (detection only, lowering TODO)
- Unify router to use extract_features()/classify() instead of legacy
- Remove AST dependency, use LoopForm/LoopScope only
- Add Pattern 4 test file (loop_continue_pattern4.hako)
- Pattern 3 test passes (sum=9)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-06 00:10:27 +09:00

18 lines
300 B
Plaintext

// Pattern 4: Loop with Continue
// Expected output: sum = 25 (1+3+5+7+9, skip even numbers)
static box Main {
main() {
local i = 0
local sum = 0
loop(i < 10) {
i = i + 1
if (i % 2 == 0) {
continue
}
sum = sum + i
}
print(sum)
return 0
}
}