mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-23 18:21:13 +08:00
fix: 修复嵌套花括号包裹初始化语法无法编译问题
This commit is contained in:
@@ -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)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user