2025-09-04 06:27:39 +09:00
|
|
|
// Expression lowering split from builder.rs to keep files lean
|
2025-09-17 07:43:07 +09:00
|
|
|
use super::{ConstValue, MirInstruction, ValueId};
|
2025-09-17 08:10:21 +09:00
|
|
|
use crate::ast::{ASTNode, AssignStmt, ReturnStmt, BinaryExpr, CallExpr, MethodCallExpr, FieldAccessExpr};
|
2025-09-04 06:27:39 +09:00
|
|
|
|
|
|
|
|
impl super::MirBuilder {
|
|
|
|
|
// Main expression dispatcher
|
|
|
|
|
pub(super) fn build_expression_impl(&mut self, ast: ASTNode) -> Result<ValueId, String> {
|
2025-09-17 07:43:07 +09:00
|
|
|
if matches!(
|
|
|
|
|
ast,
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
ASTNode::Program { .. }
|
2025-09-17 07:43:07 +09:00
|
|
|
| ASTNode::If { .. }
|
|
|
|
|
| ASTNode::Loop { .. }
|
|
|
|
|
| ASTNode::TryCatch { .. }
|
|
|
|
|
| ASTNode::Throw { .. }
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
) {
|
|
|
|
|
return self.build_expression_impl_legacy(ast);
|
|
|
|
|
}
|
2025-09-04 06:27:39 +09:00
|
|
|
match ast {
|
|
|
|
|
ASTNode::Literal { value, .. } => self.build_literal(value),
|
|
|
|
|
|
2025-09-17 07:59:41 +09:00
|
|
|
node @ ASTNode::BinaryOp { .. } => {
|
|
|
|
|
// Use BinaryExpr for clear destructuring (no behavior change)
|
|
|
|
|
let e = BinaryExpr::try_from(node).expect("ASTNode::BinaryOp must convert");
|
|
|
|
|
self.build_binary_op(*e.left, e.operator, *e.right)
|
|
|
|
|
}
|
2025-09-04 06:27:39 +09:00
|
|
|
|
2025-09-17 07:43:07 +09:00
|
|
|
ASTNode::UnaryOp {
|
|
|
|
|
operator, operand, ..
|
|
|
|
|
} => {
|
2025-09-04 06:27:39 +09:00
|
|
|
let op_string = match operator {
|
|
|
|
|
crate::ast::UnaryOperator::Minus => "-".to_string(),
|
|
|
|
|
crate::ast::UnaryOperator::Not => "not".to_string(),
|
2025-09-27 08:45:25 +09:00
|
|
|
crate::ast::UnaryOperator::BitNot => "~".to_string(),
|
2025-09-04 06:27:39 +09:00
|
|
|
};
|
|
|
|
|
self.build_unary_op(op_string, *operand)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ASTNode::Variable { name, .. } => self.build_variable_access(name.clone()),
|
|
|
|
|
|
|
|
|
|
ASTNode::Me { .. } => self.build_me_expression(),
|
|
|
|
|
|
2025-09-17 08:10:21 +09:00
|
|
|
node @ ASTNode::MethodCall { .. } => {
|
|
|
|
|
let m = MethodCallExpr::try_from(node).expect("ASTNode::MethodCall must convert");
|
|
|
|
|
if (m.method == "is" || m.method == "as") && m.arguments.len() == 1 {
|
|
|
|
|
if let Some(type_name) = Self::extract_string_literal(&m.arguments[0]) {
|
|
|
|
|
let obj_val = self.build_expression_impl(*m.object.clone())?;
|
2025-09-04 06:27:39 +09:00
|
|
|
let ty = Self::parse_type_name_to_mir(&type_name);
|
|
|
|
|
let dst = self.value_gen.next();
|
2025-09-17 08:10:21 +09:00
|
|
|
let op = if m.method == "is" { crate::mir::TypeOpKind::Check } else { crate::mir::TypeOpKind::Cast };
|
|
|
|
|
self.emit_instruction(MirInstruction::TypeOp { dst, op, value: obj_val, ty })?;
|
2025-09-04 06:27:39 +09:00
|
|
|
return Ok(dst);
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-09-17 08:10:21 +09:00
|
|
|
self.build_method_call(*m.object.clone(), m.method.clone(), m.arguments.clone())
|
2025-09-04 06:27:39 +09:00
|
|
|
}
|
|
|
|
|
|
2025-09-17 07:43:07 +09:00
|
|
|
ASTNode::FromCall {
|
|
|
|
|
parent,
|
|
|
|
|
method,
|
|
|
|
|
arguments,
|
|
|
|
|
..
|
|
|
|
|
} => self.build_from_expression(parent.clone(), method.clone(), arguments.clone()),
|
2025-09-04 06:27:39 +09:00
|
|
|
|
2025-09-17 07:57:29 +09:00
|
|
|
node @ ASTNode::Assignment { .. } => {
|
|
|
|
|
// Use AssignStmt wrapper for clearer destructuring (no behavior change)
|
|
|
|
|
let stmt = AssignStmt::try_from(node).expect("ASTNode::Assignment must convert");
|
|
|
|
|
if let ASTNode::FieldAccess { object, field, .. } = stmt.target.as_ref() {
|
|
|
|
|
self.build_field_assignment(*object.clone(), field.clone(), *stmt.value.clone())
|
|
|
|
|
} else if let ASTNode::Variable { name, .. } = stmt.target.as_ref() {
|
|
|
|
|
self.build_assignment(name.clone(), *stmt.value.clone())
|
2025-09-04 06:27:39 +09:00
|
|
|
} else {
|
|
|
|
|
Err("Complex assignment targets not yet supported".to_string())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-17 07:59:41 +09:00
|
|
|
node @ ASTNode::FunctionCall { .. } => {
|
|
|
|
|
let c = CallExpr::try_from(node).expect("ASTNode::FunctionCall must convert");
|
|
|
|
|
self.build_function_call(c.name, c.arguments)
|
|
|
|
|
}
|
2025-09-04 06:27:39 +09:00
|
|
|
|
2025-09-17 07:43:07 +09:00
|
|
|
ASTNode::Call {
|
|
|
|
|
callee, arguments, ..
|
|
|
|
|
} => self.build_indirect_call_expression(*callee.clone(), arguments.clone()),
|
2025-09-04 06:27:39 +09:00
|
|
|
|
2025-09-17 07:43:07 +09:00
|
|
|
ASTNode::QMarkPropagate { expression, .. } => {
|
|
|
|
|
self.build_qmark_propagate_expression(*expression.clone())
|
|
|
|
|
}
|
2025-09-04 06:27:39 +09:00
|
|
|
|
2025-09-23 09:00:07 +09:00
|
|
|
ASTNode::MatchExpr {
|
2025-09-17 07:43:07 +09:00
|
|
|
scrutinee,
|
|
|
|
|
arms,
|
|
|
|
|
else_expr,
|
|
|
|
|
..
|
|
|
|
|
} => self.build_peek_expression(*scrutinee.clone(), arms.clone(), *else_expr.clone()),
|
2025-09-04 06:27:39 +09:00
|
|
|
|
2025-09-17 07:43:07 +09:00
|
|
|
ASTNode::Lambda { params, body, .. } => {
|
|
|
|
|
self.build_lambda_expression(params.clone(), body.clone())
|
|
|
|
|
}
|
2025-09-04 06:27:39 +09:00
|
|
|
|
2025-09-17 07:57:29 +09:00
|
|
|
node @ ASTNode::Return { .. } => {
|
|
|
|
|
// Use ReturnStmt wrapper for consistent access (no behavior change)
|
|
|
|
|
let stmt = ReturnStmt::try_from(node).expect("ASTNode::Return must convert");
|
|
|
|
|
self.build_return_statement(stmt.value.clone())
|
|
|
|
|
}
|
2025-09-04 06:27:39 +09:00
|
|
|
|
2025-09-15 22:14:42 +09:00
|
|
|
// Control flow: break/continue are handled inside LoopBuilder context
|
2025-09-17 07:43:07 +09:00
|
|
|
ASTNode::Local {
|
|
|
|
|
variables,
|
|
|
|
|
initial_values,
|
|
|
|
|
..
|
|
|
|
|
} => self.build_local_statement(variables.clone(), initial_values.clone()),
|
2025-09-15 22:14:42 +09:00
|
|
|
|
2025-09-17 07:43:07 +09:00
|
|
|
ASTNode::BoxDeclaration {
|
|
|
|
|
name,
|
|
|
|
|
methods,
|
|
|
|
|
is_static,
|
|
|
|
|
fields,
|
|
|
|
|
constructors,
|
|
|
|
|
weak_fields,
|
|
|
|
|
..
|
|
|
|
|
} => {
|
2025-09-04 06:27:39 +09:00
|
|
|
if is_static && name == "Main" {
|
2025-09-24 21:45:27 +09:00
|
|
|
// Special entry box: materialize main() as Program and lower others as static functions
|
2025-09-04 06:27:39 +09:00
|
|
|
self.build_static_main_box(name.clone(), methods.clone())
|
2025-09-24 21:45:27 +09:00
|
|
|
} else if is_static {
|
|
|
|
|
// Generic static box: lower all static methods into standalone MIR functions (BoxName.method/N)
|
|
|
|
|
self.user_defined_boxes.insert(name.clone());
|
|
|
|
|
for (method_name, method_ast) in methods.clone() {
|
|
|
|
|
if let ASTNode::FunctionDeclaration { params, body, .. } = method_ast {
|
|
|
|
|
let func_name = format!(
|
|
|
|
|
"{}.{}{}",
|
|
|
|
|
name,
|
|
|
|
|
method_name,
|
|
|
|
|
format!("/{}", params.len())
|
|
|
|
|
);
|
|
|
|
|
self.lower_static_method_as_function(
|
|
|
|
|
func_name,
|
|
|
|
|
params.clone(),
|
|
|
|
|
body.clone(),
|
|
|
|
|
)?;
|
2025-09-25 10:23:14 +09:00
|
|
|
// Index static method for fallback resolution of bare calls
|
|
|
|
|
self.static_method_index
|
|
|
|
|
.entry(method_name.clone())
|
|
|
|
|
.or_insert_with(Vec::new)
|
|
|
|
|
.push((name.clone(), params.len()));
|
2025-09-24 21:45:27 +09:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Return void for declaration context
|
2025-09-28 20:38:09 +09:00
|
|
|
let void_val = crate::mir::builder::emission::constant::emit_void(self);
|
2025-09-24 21:45:27 +09:00
|
|
|
Ok(void_val)
|
2025-09-04 06:27:39 +09:00
|
|
|
} else {
|
2025-09-24 21:45:27 +09:00
|
|
|
// Instance box: register type and lower instance methods/ctors as functions
|
2025-09-04 06:27:39 +09:00
|
|
|
self.user_defined_boxes.insert(name.clone());
|
2025-09-17 07:43:07 +09:00
|
|
|
self.build_box_declaration(
|
|
|
|
|
name.clone(),
|
|
|
|
|
methods.clone(),
|
|
|
|
|
fields.clone(),
|
|
|
|
|
weak_fields.clone(),
|
|
|
|
|
)?;
|
2025-09-04 06:27:39 +09:00
|
|
|
for (ctor_key, ctor_ast) in constructors.clone() {
|
|
|
|
|
if let ASTNode::FunctionDeclaration { params, body, .. } = ctor_ast {
|
|
|
|
|
let func_name = format!("{}.{}", name, ctor_key);
|
2025-09-17 07:43:07 +09:00
|
|
|
self.lower_method_as_function(
|
|
|
|
|
func_name,
|
|
|
|
|
name.clone(),
|
|
|
|
|
params.clone(),
|
|
|
|
|
body.clone(),
|
|
|
|
|
)?;
|
2025-09-04 06:27:39 +09:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (method_name, method_ast) in methods.clone() {
|
2025-09-17 07:43:07 +09:00
|
|
|
if let ASTNode::FunctionDeclaration {
|
|
|
|
|
params,
|
|
|
|
|
body,
|
|
|
|
|
is_static,
|
|
|
|
|
..
|
|
|
|
|
} = method_ast
|
|
|
|
|
{
|
2025-09-04 06:27:39 +09:00
|
|
|
if !is_static {
|
2025-09-17 07:43:07 +09:00
|
|
|
let func_name = format!(
|
|
|
|
|
"{}.{}{}",
|
|
|
|
|
name,
|
|
|
|
|
method_name,
|
|
|
|
|
format!("/{}", params.len())
|
|
|
|
|
);
|
|
|
|
|
self.lower_method_as_function(
|
|
|
|
|
func_name,
|
|
|
|
|
name.clone(),
|
|
|
|
|
params.clone(),
|
|
|
|
|
body.clone(),
|
|
|
|
|
)?;
|
2025-09-04 06:27:39 +09:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-09-28 20:38:09 +09:00
|
|
|
let void_val = crate::mir::builder::emission::constant::emit_void(self);
|
2025-09-04 06:27:39 +09:00
|
|
|
Ok(void_val)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-17 08:10:21 +09:00
|
|
|
node @ ASTNode::FieldAccess { .. } => {
|
|
|
|
|
let f = FieldAccessExpr::try_from(node).expect("ASTNode::FieldAccess must convert");
|
|
|
|
|
self.build_field_access(*f.object.clone(), f.field.clone())
|
2025-09-17 07:43:07 +09:00
|
|
|
}
|
2025-09-04 06:27:39 +09:00
|
|
|
|
2025-09-17 07:43:07 +09:00
|
|
|
ASTNode::New {
|
|
|
|
|
class, arguments, ..
|
|
|
|
|
} => self.build_new_expression(class.clone(), arguments.clone()),
|
2025-09-04 06:27:39 +09:00
|
|
|
|
2025-09-16 06:13:44 +09:00
|
|
|
ASTNode::ArrayLiteral { elements, .. } => {
|
|
|
|
|
let arr_id = self.value_gen.next();
|
2025-09-17 07:43:07 +09:00
|
|
|
self.emit_instruction(MirInstruction::NewBox {
|
|
|
|
|
dst: arr_id,
|
|
|
|
|
box_type: "ArrayBox".to_string(),
|
|
|
|
|
args: vec![],
|
|
|
|
|
})?;
|
2025-09-16 06:13:44 +09:00
|
|
|
for e in elements {
|
|
|
|
|
let v = self.build_expression_impl(e)?;
|
2025-09-17 07:43:07 +09:00
|
|
|
self.emit_instruction(MirInstruction::BoxCall {
|
|
|
|
|
dst: None,
|
|
|
|
|
box_val: arr_id,
|
|
|
|
|
method: "push".to_string(),
|
|
|
|
|
method_id: None,
|
|
|
|
|
args: vec![v],
|
|
|
|
|
effects: super::EffectMask::MUT,
|
|
|
|
|
})?;
|
2025-09-16 06:13:44 +09:00
|
|
|
}
|
|
|
|
|
Ok(arr_id)
|
|
|
|
|
}
|
|
|
|
|
ASTNode::MapLiteral { entries, .. } => {
|
|
|
|
|
let map_id = self.value_gen.next();
|
2025-09-17 07:43:07 +09:00
|
|
|
self.emit_instruction(MirInstruction::NewBox {
|
|
|
|
|
dst: map_id,
|
|
|
|
|
box_type: "MapBox".to_string(),
|
|
|
|
|
args: vec![],
|
|
|
|
|
})?;
|
2025-09-16 06:13:44 +09:00
|
|
|
for (k, expr) in entries {
|
|
|
|
|
// const string key
|
2025-09-28 20:38:09 +09:00
|
|
|
let k_id = crate::mir::builder::emission::constant::emit_string(self, k);
|
2025-09-16 06:13:44 +09:00
|
|
|
let v_id = self.build_expression_impl(expr)?;
|
2025-09-17 07:43:07 +09:00
|
|
|
self.emit_instruction(MirInstruction::BoxCall {
|
|
|
|
|
dst: None,
|
|
|
|
|
box_val: map_id,
|
|
|
|
|
method: "set".to_string(),
|
|
|
|
|
method_id: None,
|
|
|
|
|
args: vec![k_id, v_id],
|
|
|
|
|
effects: super::EffectMask::MUT,
|
|
|
|
|
})?;
|
2025-09-16 06:13:44 +09:00
|
|
|
}
|
|
|
|
|
Ok(map_id)
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-17 07:43:07 +09:00
|
|
|
ASTNode::Nowait {
|
|
|
|
|
variable,
|
|
|
|
|
expression,
|
|
|
|
|
..
|
|
|
|
|
} => self.build_nowait_statement(variable.clone(), *expression.clone()),
|
2025-09-04 06:27:39 +09:00
|
|
|
|
2025-09-17 07:43:07 +09:00
|
|
|
ASTNode::AwaitExpression { expression, .. } => {
|
|
|
|
|
self.build_await_expression(*expression.clone())
|
|
|
|
|
}
|
2025-09-04 06:27:39 +09:00
|
|
|
|
2025-09-25 00:41:56 +09:00
|
|
|
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
|
2025-09-19 08:34:29 +09:00
|
|
|
ASTNode::Program { statements, .. } => self.cf_block(statements.clone()),
|
2025-09-21 08:53:00 +09:00
|
|
|
ASTNode::ScopeBox { body, .. } => self.cf_block(body.clone()),
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
|
2025-09-17 07:43:07 +09:00
|
|
|
ASTNode::Print { expression, .. } => self.build_print_statement(*expression.clone()),
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
|
2025-09-17 07:43:07 +09:00
|
|
|
ASTNode::If {
|
|
|
|
|
condition,
|
|
|
|
|
then_body,
|
|
|
|
|
else_body,
|
|
|
|
|
..
|
|
|
|
|
} => {
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
let else_ast = if let Some(else_statements) = else_body {
|
2025-09-17 07:43:07 +09:00
|
|
|
Some(ASTNode::Program {
|
|
|
|
|
statements: else_statements.clone(),
|
|
|
|
|
span: crate::ast::Span::unknown(),
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
None
|
|
|
|
|
};
|
2025-09-19 08:34:29 +09:00
|
|
|
self.cf_if(
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
*condition.clone(),
|
2025-09-17 07:43:07 +09:00
|
|
|
ASTNode::Program {
|
|
|
|
|
statements: then_body.clone(),
|
|
|
|
|
span: crate::ast::Span::unknown(),
|
|
|
|
|
},
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
else_ast,
|
|
|
|
|
)
|
2025-09-04 06:27:39 +09:00
|
|
|
}
|
|
|
|
|
|
2025-09-17 07:43:07 +09:00
|
|
|
ASTNode::Loop {
|
|
|
|
|
condition, body, ..
|
2025-09-19 08:34:29 +09:00
|
|
|
} => self.cf_loop(*condition.clone(), body.clone()),
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
|
2025-09-17 07:43:07 +09:00
|
|
|
ASTNode::TryCatch {
|
|
|
|
|
try_body,
|
|
|
|
|
catch_clauses,
|
|
|
|
|
finally_body,
|
|
|
|
|
..
|
2025-09-19 08:34:29 +09:00
|
|
|
} => self.cf_try_catch(
|
2025-09-17 07:43:07 +09:00
|
|
|
try_body.clone(),
|
|
|
|
|
catch_clauses.clone(),
|
|
|
|
|
finally_body.clone(),
|
|
|
|
|
),
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
|
2025-09-19 08:34:29 +09:00
|
|
|
ASTNode::Throw { expression, .. } => self.cf_throw(*expression.clone()),
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
|
2025-09-04 06:27:39 +09:00
|
|
|
_ => Err(format!("Unsupported AST node type: {:?}", ast)),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|