feat(joinir): Phase 172 - Trim pattern JoinIR lowering implementation
Implement actual MIR generation for Trim pattern loops, enabling LoopBodyLocal variables to work through bool carrier promotion. ## Implementation (pattern2_with_break.rs) - emit_whitespace_check(): Generate OR chain for whitespace comparison - extract_substring_args(): Extract s, start from substring call - Initial carrier generation: ch0 = s.substring(start, start+1) - Whitespace check: is_ch_match0 = (ch0 == " " || "\t" || "\n" || "\r") - ConditionEnv integration: Register carrier for JoinIR condition - Break condition replacement: !is_ch_match instead of original ch checks ## Architecture - Host MIR: substring calls, OR chain evaluation, BoxCall - JoinIR: Only sees bool carrier for break control - No new JoinIR instructions added ## Documentation - phase172-trim-lowering-impl.md: Design and implementation details - loop_pattern_space.md: Analysis of all loop pattern combinations Test: Trim loops compile and generate JoinIR successfully Build: 0 errors, clean compilation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -247,3 +247,7 @@ JoinIR は Rust 側だけでなく、将来的に .hako selfhost コンパイラ
|
||||
- 185–188: Strict mode / LoopBuilder 削除 / Pattern1–4 基盤
|
||||
- 189–193: Multi-function merge / Select bridge / ExitLine 箱化
|
||||
- 171–172 / 33‑10/13: ConditionEnv, ConditionBinding, JoinFragmentMeta, ExitLineRefactor 等
|
||||
- `docs/development/current/main/loop_pattern_space.md`
|
||||
- JoinIR ループパターン空間の整理メモ。
|
||||
どの軸(継続条件 / break / continue / PHI / 条件変数スコープ / 更新パターン)でパターンを分けるか、
|
||||
そして P1–P4 / Trim(P5) の位置づけと、今後追加候補のパターン一覧がまとまっている。
|
||||
|
||||
Reference in New Issue
Block a user