refactor(joinir): move P5b escape policy under patterns/policies
This commit is contained in:
@ -53,7 +53,6 @@ pub(in crate::mir::builder) mod ast_feature_extractor;
|
|||||||
pub(in crate::mir::builder) mod policies; // Phase 93/94: Pattern routing policies (future expansion)
|
pub(in crate::mir::builder) mod policies; // Phase 93/94: Pattern routing policies (future expansion)
|
||||||
pub(in crate::mir::builder) mod body_local_policy; // Phase 92 P3: promotion vs slot routing
|
pub(in crate::mir::builder) mod body_local_policy; // Phase 92 P3: promotion vs slot routing
|
||||||
pub(in crate::mir::builder) mod escape_pattern_recognizer; // Phase 91 P5b
|
pub(in crate::mir::builder) mod escape_pattern_recognizer; // Phase 91 P5b
|
||||||
pub(in crate::mir::builder) mod p5b_escape_derived_policy; // Phase 94: derived `ch` + conditional counter
|
|
||||||
pub(in crate::mir::builder) mod common_init;
|
pub(in crate::mir::builder) mod common_init;
|
||||||
pub(in crate::mir::builder) mod condition_env_builder;
|
pub(in crate::mir::builder) mod condition_env_builder;
|
||||||
pub(in crate::mir::builder) mod conversion_pipeline;
|
pub(in crate::mir::builder) mod conversion_pipeline;
|
||||||
|
|||||||
@ -17,7 +17,9 @@ use crate::mir::join_ir::lowering::loop_update_analyzer::UpdateExpr;
|
|||||||
use crate::mir::loop_pattern_detection::error_messages;
|
use crate::mir::loop_pattern_detection::error_messages;
|
||||||
use crate::mir::loop_pattern_detection::function_scope_capture::CapturedEnv;
|
use crate::mir::loop_pattern_detection::function_scope_capture::CapturedEnv;
|
||||||
use crate::mir::ValueId;
|
use crate::mir::ValueId;
|
||||||
use super::p5b_escape_derived_policy::{classify_p5b_escape_derived, P5bEscapeDerivedDecision};
|
use super::policies::p5b_escape_derived_policy::{
|
||||||
|
classify_p5b_escape_derived, P5bEscapeDerivedDecision,
|
||||||
|
};
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
||||||
struct Pattern2DebugLog {
|
struct Pattern2DebugLog {
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
### p5b_escape_derived_policy.rs (Phase 94)
|
### p5b_escape_derived_policy.rs (Phase 94)
|
||||||
**現在の場所**: `patterns/p5b_escape_derived_policy.rs`
|
**現在の場所**: `patterns/policies/p5b_escape_derived_policy.rs`
|
||||||
|
|
||||||
**責務**: P5b escapeパターン認識とBodyLocalDerivedルーティング
|
**責務**: P5b escapeパターン認識とBodyLocalDerivedルーティング
|
||||||
|
|
||||||
@ -51,8 +51,7 @@
|
|||||||
- `P5bEscapeDerivedDecision::None` - 該当なし
|
- `P5bEscapeDerivedDecision::None` - 該当なし
|
||||||
|
|
||||||
**将来的な整理**:
|
**将来的な整理**:
|
||||||
- policies/へ移動してpolicy箱として統一
|
- policies/配下でpolicy箱として統一済み(Phase 96)
|
||||||
- 現在はpatterns/直下に配置
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@ -14,16 +14,14 @@
|
|||||||
//! - **Fail-Fast**: パターンマッチング失敗は即座にReject/Noneを返す
|
//! - **Fail-Fast**: パターンマッチング失敗は即座にReject/Noneを返す
|
||||||
//!
|
//!
|
||||||
//! ## 将来の拡張
|
//! ## 将来の拡張
|
||||||
//! 現在はpolicies/ディレクトリの準備段階です。
|
//! policies/ は「認識とルーティング決定(policy)」を分離する受け皿です。
|
||||||
//! 既存のpolicy関連ファイル(p5b_escape_derived_policy.rs, body_local_policy.rs等)は
|
//! Phase 94(P5b derived)から段階的に移設を開始しました。
|
||||||
//! patterns/直下に配置されていますが、将来的にこのディレクトリへ移動する予定です。
|
|
||||||
//!
|
//!
|
||||||
//! ### 段階的な移行計画
|
//! ### 段階的な移行計画
|
||||||
//! - Phase 1: ディレクトリ準備(今回) ✅
|
//! - Phase 1: ディレクトリ準備 ✅
|
||||||
//! - Phase 2: 既存policy箱の移動(将来)
|
//! - Phase 2: 既存policy箱の移動(進行中)
|
||||||
//! - Phase 3: インターフェース統一(将来)
|
//! - Phase 3: インターフェース統一(将来)
|
||||||
//!
|
//!
|
||||||
//! 詳細は [README.md](README.md) を参照してください。
|
//! 詳細は [README.md](README.md) を参照してください。
|
||||||
|
|
||||||
// 現在は空モジュール(将来の拡張用)
|
pub(in crate::mir::builder) mod p5b_escape_derived_policy;
|
||||||
// 既存のpolicy関連ファイルは親モジュール(patterns/)に配置されています
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@ pub fn classify_p5b_escape_derived(
|
|||||||
body: &[ASTNode],
|
body: &[ASTNode],
|
||||||
loop_var_name: &str,
|
loop_var_name: &str,
|
||||||
) -> P5bEscapeDerivedDecision {
|
) -> P5bEscapeDerivedDecision {
|
||||||
let Some(info) = super::ast_feature_extractor::detect_escape_skip_pattern(body) else {
|
let Some(info) = super::super::ast_feature_extractor::detect_escape_skip_pattern(body) else {
|
||||||
return P5bEscapeDerivedDecision::None;
|
return P5bEscapeDerivedDecision::None;
|
||||||
};
|
};
|
||||||
|
|
||||||
Reference in New Issue
Block a user