feat(control_tree): add StepTreeContract and signature (dev-only)
This commit is contained in:
@ -41,6 +41,7 @@ pub(in crate::mir::builder) fn choose_pattern_kind(
|
||||
// Phase 193: Use AST Feature Extractor Box for break/continue detection
|
||||
let has_continue = ast_features::detect_continue_in_body(body);
|
||||
let has_break = ast_features::detect_break_in_body(body);
|
||||
let has_return = ast_features::detect_return_in_body(body);
|
||||
|
||||
// Phase 110: StepTree parity check (structure-only SSOT).
|
||||
//
|
||||
@ -56,10 +57,18 @@ pub(in crate::mir::builder) fn choose_pattern_kind(
|
||||
};
|
||||
|
||||
let tree = StepTreeBuilderBox::build_from_ast(&loop_ast);
|
||||
if tree.features.has_break != has_break || tree.features.has_continue != has_continue {
|
||||
if tree.features.has_break != has_break
|
||||
|| tree.features.has_continue != has_continue
|
||||
|| tree.features.has_return != has_return
|
||||
{
|
||||
let msg = format!(
|
||||
"[choose_pattern_kind/STEPTREE_PARITY] step_tree(break={}, cont={}) != extractor(break={}, cont={})",
|
||||
tree.features.has_break, tree.features.has_continue, has_break, has_continue
|
||||
"[choose_pattern_kind/STEPTREE_PARITY] step_tree(break={}, cont={}, ret={}) != extractor(break={}, cont={}, ret={})",
|
||||
tree.features.has_break,
|
||||
tree.features.has_continue,
|
||||
tree.features.has_return,
|
||||
has_break,
|
||||
has_continue,
|
||||
has_return
|
||||
);
|
||||
|
||||
if crate::config::env::joinir_dev::strict_enabled() {
|
||||
|
||||
Reference in New Issue
Block a user