1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: minor cleanup in partial_assign_stmt() (#14929)

This commit is contained in:
yuyi 2022-07-03 20:24:42 +08:00 committed by GitHub
parent 20ba2a10c1
commit 9028b0ed76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {