From 8e027c4f9d78a91a5dece36c9b84a50cc7daf6e1 Mon Sep 17 00:00:00 2001 From: pjh456 <147148383@qq.com> Date: Fri, 5 Jun 2026 19:42:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B5=8C=E5=A5=97?= =?UTF-8?q?=E8=8A=B1=E6=8B=AC=E5=8F=B7=E5=8C=85=E8=A3=B9=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E8=AF=AD=E6=B3=95=E6=97=A0=E6=B3=95=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/oxide_compiler/src/compiler.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/oxide_compiler/src/compiler.rs b/crates/oxide_compiler/src/compiler.rs index d5ebf6ea..5d7e983e 100644 --- a/crates/oxide_compiler/src/compiler.rs +++ b/crates/oxide_compiler/src/compiler.rs @@ -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)), } } }