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

parser: handle a,b += 1,1 (fix #5735) (#5783)

This commit is contained in:
Swastik Baranwal 2020-07-10 17:29:17 +05:30 committed by GitHub
parent 1a9690cc62
commit 9839b0eb7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,6 +93,9 @@ fn (mut p Parser) partial_assign_stmt(left []ast.Expr) ast.Stmt {
// a, b = b, a
for r in right {
has_cross_var = p.check_cross_variables(left, r)
if op !in [.assign, .decl_assign] {
p.error('unexpected $op.str(), expecting := or = or comma')
}
if has_cross_var {
break
}