nyash-codex
3127ebb73d
feat(mir): Phase 136 Step 3/7 - ScopeContext extraction
## Summary
Extract scope and control flow management into ScopeContext for better organization.
## Changes
- **New file**: src/mir/builder/scope_context.rs (264 lines)
- Lexical scope stack management
- Control flow stacks (loop/if)
- Function context tracking
- Debug scope helpers
- **Updated**: src/mir/builder.rs
- Add scope_ctx field
- Mark legacy fields as deprecated
- Add sync helpers (sync_scope_ctx_to_legacy, sync_legacy_to_scope_ctx)
- **Updated**: src/mir/builder/vars/lexical_scope.rs
- Use scope_ctx as SSOT
- Sync to legacy fields for backward compat
- **Updated**: src/mir/builder/lifecycle.rs
- Sync current_function via scope_ctx
- **Updated**: src/mir/builder/calls/lowering.rs
- Sync function context in lowering flow
## Extracted Fields (7)
1. lexical_scope_stack - Block-scoped locals
2. loop_header_stack - Loop headers for break/continue
3. loop_exit_stack - Loop exit blocks
4. if_merge_stack - If merge blocks
5. current_function - Currently building function
6. function_param_names - Function parameters (for LoopForm)
7. debug_scope_stack - Debug region identifiers
## Test Results
- ✅ cargo build --release (291 warnings - deprecated usage)
- ✅ cargo test --release --lib - 1005/1009 PASS
- ✅ phase135_trim_mir_verify.sh - PASS
- ⚠️ phase132_exit_phi_parity.sh - Error (pre-existing issue)
## Progress
Phase 136: 3/7 Contexts complete (TypeContext, CoreContext, ScopeContext)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-15 20:28:21 +09:00
..
2025-12-08 23:43:26 +09:00
2025-12-04 13:32:58 +09:00
2025-12-11 20:54:33 +09:00
2025-09-24 14:13:15 +09:00
2025-12-12 23:11:45 +09:00
2025-08-18 20:53:48 +09:00
2025-12-10 00:01:53 +09:00
2025-12-11 20:54:33 +09:00
2025-11-21 06:25:17 +09:00
2025-12-11 20:54:33 +09:00
2025-12-10 00:01:53 +09:00
2025-12-13 19:01:14 +09:00
2025-09-17 07:43:07 +09:00
2025-11-21 06:25:17 +09:00
2025-12-03 19:58:50 +09:00
2025-11-22 05:33:40 +09:00
2025-12-15 12:12:54 +09:00
2025-11-29 12:44:40 +09:00
2025-09-17 07:43:07 +09:00
2025-12-15 20:28:21 +09:00
2025-12-07 23:45:55 +09:00
2025-12-11 20:54:33 +09:00
2025-11-10 23:17:46 +09:00
2025-12-15 17:49:08 +09:00
2025-12-15 17:00:51 +09:00
2025-09-23 02:15:56 +09:00
2025-11-21 06:25:17 +09:00
2025-09-17 07:43:07 +09:00
2025-12-12 03:15:45 +09:00
2025-11-30 14:30:28 +09:00
2025-09-17 07:43:07 +09:00
2025-11-30 14:30:28 +09:00
2025-12-13 01:30:04 +09:00
2025-11-20 03:56:12 +09:00
2025-11-21 06:25:17 +09:00
2025-11-21 06:25:17 +09:00
2025-11-21 06:25:17 +09:00
2025-09-17 07:43:07 +09:00
2025-11-13 18:55:14 +09:00
2025-09-17 07:43:07 +09:00
2025-09-17 07:43:07 +09:00
2025-12-08 23:43:26 +09:00
2025-11-21 06:25:17 +09:00
2025-12-11 20:54:33 +09:00
2025-09-17 07:43:07 +09:00
2025-09-17 07:43:07 +09:00
2025-12-01 11:10:46 +09:00
2025-09-17 07:43:07 +09:00
2025-09-19 12:13:43 +09:00
2025-09-17 07:43:07 +09:00
2025-09-17 07:43:07 +09:00