fix: 修复嵌套花括号包裹初始化语法无法编译问题

This commit is contained in:
爱特每羊队
2026-06-05 19:42:11 +08:00
parent ea94971706
commit 8143e0670b
+5 -4
View File
@@ -230,6 +230,9 @@ impl Compiler {
self.count_expression(&member.expression, ctx);
ctx.alloc_reg();
}
Expression::ParenthesizedExpression(p) => {
self.count_expression(&p.expression, ctx);
}
_ => {
ctx.alloc_reg();
}
@@ -493,10 +496,8 @@ impl Compiler {
Err("assignment target not supported".into())
}
}
_ => Err(format!(
"unsupported expression type: {:?}",
std::mem::discriminant(expr)
)),
Expression::ParenthesizedExpression(p) => self.emit_expression(&p.expression, ctx),
_ => Err(format!("unsupported expression type: {:?}", expr)),
}
}
}