Commit Graph

8 Commits

Author SHA1 Message Date
af6f95cd4b Phase 33 NORM canon test: enforce normalized dev route for P1/P2/JP mini 2025-12-11 20:54:33 +09:00
d7805e5974 feat(joinir): Phase 213-2 Step 2-2 & 2-3 Data structure extensions
Extended PatternPipelineContext and CarrierUpdateInfo for Pattern 3 AST-based generalization.

Changes:
1. PatternPipelineContext:
   - Added loop_condition: Option<ASTNode>
   - Added loop_body: Option<Vec<ASTNode>>
   - Added loop_update_summary: Option<LoopUpdateSummary>
   - Updated build_pattern_context() for Pattern 3

2. CarrierUpdateInfo:
   - Added then_expr: Option<ASTNode>
   - Added else_expr: Option<ASTNode>
   - Updated analyze_loop_updates() with None defaults

Status: Phase 213-2 Steps 2-2 & 2-3 complete
Next: Create Pattern3IfAnalyzer to extract if statement and populate update summary
2025-12-10 00:01:53 +09:00
c183557799 chore: cargo fix - remove unused imports
Phase 33-11 Quick Wins - Task 1

- Removed 10 unused imports across JoinIR lowering modules
- Applied via 'cargo fix --allow-dirty'
- No logic changes, only cleanup
- Build:  Success (0 errors, 44 warnings)

Files modified:
- src/mir/join_ir/lowering/generic_case_a/*.rs (5 files)
- src/mir/join_ir/lowering/{if_merge,if_select,loop_patterns,simple_while_minimal}.rs
- src/mir/join_ir_vm_bridge/joinir_function_converter.rs
- src/mir/builder/control_flow/joinir/merge/exit_line/reconnector.rs
2025-12-07 03:12:51 +09:00
89e138a2f8 docs: Complete generic_case_a modularization (Phase 5)
- Updated mod.rs with comprehensive module organization documentation
- Documented before/after line counts and size reductions
- Removed old generic_case_a_old.rs monolith file
- Verified all imports are clean (no unused warnings)
- Verified all visibility is correct (pub(crate) for public API)

Final statistics:
- Before: 1,056 lines in single file
- After: 1,634 lines across 7 focused modules
- Main coordinator: 93 lines (91% reduction)
- Average module size: 233 lines (manageable, focused)
- Largest module: trim.rs at 537 lines (still maintainable)

All success criteria met:
 All 7 modules created
 cargo build --release succeeds
 Zero breaking changes (all APIs compatible)
 Module documentation comprehensive
 All visibility correct

Ref: Phase 192 modularization effort
2025-12-05 21:44:07 +09:00
e44e36b9cd refactor: Extract append_defs and stage1 lowerers (Phase 4)
- Created append_defs.rs with lower_case_a_append_defs_with_scope()
  - Extracted 173 lines of append_defs lowering logic
  - Implements array concatenation loop (ArrayBox.get/push)
  - ValueId allocation: entry(8000-8999), loop_step(9000-9999)

- Created stage1_using_resolver.rs with lower_case_a_stage1_usingresolver_with_scope()
  - Extracted 185 lines of stage1 using resolver logic
  - Implements namespace resolution loop with OR accumulation
  - ValueId allocation: entry(10000-10999), loop_step(11000-11999)

Both modules use EntryFunctionBuilder helper for boilerplate initialization.

Sizes: append_defs (173 lines), stage1 (185 lines)

Ref: Phase 192 modularization effort
2025-12-05 21:39:22 +09:00
957917b08b refactor: Extract trim lowerer from generic_case_a (Phase 3)
- Created trim.rs with lower_case_a_trim_with_scope() and helpers
- Extracted 480 lines of trim-specific lowering logic (largest module)
- Implements 3 functions: trim_main (entry), loop_step, skip_leading
- Comprehensive whitespace detection (space/tab/newline/CR)
- ValueId allocation: entry(5000-5999), loop_step(6000-6999), skip(7000-7999)

Size: 480 lines (largest extracted module from 1,056-line monolith)

Ref: Phase 192 modularization effort
2025-12-05 21:35:31 +09:00
f71d58a46f refactor: Extract skip_ws lowerer from generic_case_a (Phase 2)
- Created skip_ws.rs with lower_case_a_skip_ws_with_scope() and helper
- Extracted 233 lines of skip_ws-specific lowering logic
- Added comprehensive module documentation
- Uses EntryFunctionBuilder from helper module
- ValueId allocation: entry(3000-3999), loop_step(4000-5999)

Size: 233 lines (extracted from 1,056-line monolith)

Ref: Phase 192 modularization effort
2025-12-05 21:33:49 +09:00
1d7b499f4d refactor: Create generic_case_a directory structure (Phase 1)
- Created src/mir/join_ir/lowering/generic_case_a/ directory
- Moved entry_builder.rs and whitespace_check.rs into new directory
- Created mod.rs with public API exports and comprehensive documentation
- Renamed old generic_case_a.rs to generic_case_a_old.rs temporarily
- Updated parent mod.rs to import from new structure

Ref: Phase 192 modularization effort
2025-12-05 21:32:41 +09:00