feat(control_tree): add StepTree builder (dev-only)

This commit is contained in:
nyash-codex
2025-12-18 00:22:21 +09:00
parent b32480823d
commit 2b5c141e22
5 changed files with 612 additions and 0 deletions

View File

@ -166,6 +166,12 @@ impl MirBuilder {
/// 🎯 箱理論: Step 4 - 本体lowering
fn lower_function_body(&mut self, body: Vec<ASTNode>) -> Result<(), String> {
if crate::config::env::joinir_dev_enabled() {
let tree = crate::mir::control_tree::StepTreeBuilderBox::build_from_block(&body);
crate::mir::builder::control_flow::joinir::trace::trace()
.dev("control_tree/step_tree", &tree.to_compact_string());
}
eprintln!("[DEBUG/lower_function_body] body.len() = {}", body.len());
let program_ast = function_lowering::wrap_in_program(body);
eprintln!("[DEBUG/lower_function_body] About to call build_expression");