//! Phase 29ai P10: Wrapper for plan-layer Pattern2 extractor (SSOT)

use crate::ast::ASTNode;

pub(crate) use crate::mir::builder::control_flow::plan::extractors::pattern2_break::Pattern2Parts;

pub(crate) fn extract_loop_with_break_parts(
    condition: &ASTNode,
    body: &[ASTNode],
) -> Result<Option<Pattern2Parts>, String> {
    crate::mir::builder::control_flow::plan::extractors::pattern2_break::extract_loop_with_break_parts(
        condition, body,
    )
}

pub(crate) fn extract_pattern2_plan(
    condition: &ASTNode,
    body: &[ASTNode],
) -> Result<Option<crate::mir::builder::control_flow::plan::DomainPlan>, String> {
    crate::mir::builder::control_flow::plan::extractors::pattern2_break::extract_pattern2_plan(
        condition, body,
    )
}
