fix: 修复嵌套花括号包裹初始化语法无法编译问题
This commit is contained in:
@@ -230,6 +230,9 @@ impl Compiler {
|
|||||||
self.count_expression(&member.expression, ctx);
|
self.count_expression(&member.expression, ctx);
|
||||||
ctx.alloc_reg();
|
ctx.alloc_reg();
|
||||||
}
|
}
|
||||||
|
Expression::ParenthesizedExpression(p) => {
|
||||||
|
self.count_expression(&p.expression, ctx);
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
ctx.alloc_reg();
|
ctx.alloc_reg();
|
||||||
}
|
}
|
||||||
@@ -493,10 +496,8 @@ impl Compiler {
|
|||||||
Err("assignment target not supported".into())
|
Err("assignment target not supported".into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => Err(format!(
|
Expression::ParenthesizedExpression(p) => self.emit_expression(&p.expression, ctx),
|
||||||
"unsupported expression type: {:?}",
|
_ => Err(format!("unsupported expression type: {:?}", expr)),
|
||||||
std::mem::discriminant(expr)
|
|
||||||
)),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user