feat(joinir): Phase 188 StringAppend support in Pattern2/4
- Extended Pattern2/4 whitelist to accept StringLiteral updates - CarrierUpdateEmitter now emits JoinIR for string append - Selective Fail-Fast: accept safe patterns, reject complex Changes: - pattern2_with_break.rs: StringLiteral whitelist - pattern4_with_continue.rs: StringLiteral whitelist - carrier_update_emitter.rs: StringLiteral JoinIR emission Tests: - phase188_string_append_char.hako - phase188_string_append_literal.hako - 10/10 carrier_update_emitter tests PASS 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
19
apps/tests/phase188_string_append_char.hako
Normal file
19
apps/tests/phase188_string_append_char.hako
Normal file
@ -0,0 +1,19 @@
|
||||
// Phase 188: String append with character variable
|
||||
// Pattern: s = s + ch (StringAppendChar)
|
||||
// Pattern 2: Loop with conditional break
|
||||
|
||||
static box SAppendChar {
|
||||
method main() {
|
||||
local s = ""
|
||||
local i = 0
|
||||
loop(i < 10) {
|
||||
if i == 3 {
|
||||
break
|
||||
}
|
||||
local ch = "x"
|
||||
s = s + ch
|
||||
i = i + 1
|
||||
}
|
||||
print(s) // Expected: "xxx"
|
||||
}
|
||||
}
|
||||
18
apps/tests/phase188_string_append_literal.hako
Normal file
18
apps/tests/phase188_string_append_literal.hako
Normal file
@ -0,0 +1,18 @@
|
||||
// Phase 188: String append with literal
|
||||
// Pattern: s = s + "y" (StringAppendLiteral)
|
||||
// Pattern 4: Loop with continue
|
||||
|
||||
static box SAppendLit {
|
||||
method main() {
|
||||
local s = ""
|
||||
local i = 0
|
||||
loop(i < 5) {
|
||||
i = i + 1
|
||||
if i > 3 {
|
||||
continue
|
||||
}
|
||||
s = s + "y"
|
||||
}
|
||||
print(s) // Expected: "yyy"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user