From 9028b0ed76bf4a93a7ba86be226520a788c319f0 Mon Sep 17 00:00:00 2001 From: yuyi Date: Sun, 3 Jul 2022 20:24:42 +0800 Subject: [PATCH] parser: minor cleanup in partial_assign_stmt() (#14929) --- vlib/v/parser/assign.v | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/vlib/v/parser/assign.v b/vlib/v/parser/assign.v index 6b3b7f193b..7ff8a48685 100644 --- a/vlib/v/parser/assign.v +++ b/vlib/v/parser/assign.v @@ -208,7 +208,6 @@ fn (mut p Parser) partial_assign_stmt(left []ast.Expr, left_comments []ast.Comme is_volatile = true } } - r0 := right[0] mut v := ast.Var{ name: lx.name expr: if left.len == right.len { right[i] } else { ast.empty_expr() } @@ -218,6 +217,7 @@ fn (mut p Parser) partial_assign_stmt(left []ast.Expr, left_comments []ast.Comme is_stack_obj: p.inside_for } if p.pref.autofree { + r0 := right[0] if r0 is ast.CallExpr { // Set correct variable position (after the or block) // so that autofree doesn't free it in cgen before @@ -248,10 +248,7 @@ fn (mut p Parser) partial_assign_stmt(left []ast.Expr, left_comments []ast.Comme pos) } } - else { - // TODO: parexpr ( check vars) - // else { p.error_with_pos('unexpected `${typeof(lx)}`', lx.pos()) } - } + else {} } } if op == .decl_assign {