2025-12-05 20:45:23 +09:00
|
|
|
//! Pattern lowerers for different loop constructs
|
|
|
|
|
//!
|
|
|
|
|
//! Phase 2: Extracted from control_flow.rs
|
|
|
|
|
//! - Pattern 1: Simple While Loop (pattern1_minimal.rs)
|
|
|
|
|
//! - Pattern 2: Loop with Conditional Break (pattern2_with_break.rs)
|
|
|
|
|
//! - Pattern 3: Loop with If-Else PHI (pattern3_with_if_phi.rs)
|
2025-12-06 00:10:27 +09:00
|
|
|
//! - Pattern 4: Loop with Continue (pattern4_with_continue.rs) [Phase 194+]
|
2025-12-05 22:11:39 +09:00
|
|
|
//!
|
|
|
|
|
//! Phase 194: Table-driven router for pattern dispatch
|
|
|
|
|
//! - Router module provides table-driven pattern matching
|
|
|
|
|
//! - Each pattern exports can_lower() and lower() functions
|
|
|
|
|
//! - See router.rs for how to add new patterns
|
2025-12-05 20:45:23 +09:00
|
|
|
|
|
|
|
|
pub(in crate::mir::builder) mod pattern1_minimal;
|
|
|
|
|
pub(in crate::mir::builder) mod pattern2_with_break;
|
|
|
|
|
pub(in crate::mir::builder) mod pattern3_with_if_phi;
|
2025-12-06 00:10:27 +09:00
|
|
|
pub(in crate::mir::builder) mod pattern4_with_continue;
|
2025-12-05 22:11:39 +09:00
|
|
|
pub(in crate::mir::builder) mod router;
|
|
|
|
|
|
|
|
|
|
// Re-export router for convenience
|
|
|
|
|
pub(in crate::mir::builder) use router::{route_loop_pattern, LoopPatternContext};
|