++= appendAssign operator (#7346) (#7354)

# Description

Closes  https://github.com/nushell/nushell/issues/7346



# Tests + Formatting
```
> mut a = [1 2 3]
> $a ++= [4 5 6]
> $a
[1 2 3 4 5 6]
```
This commit is contained in:
raccmonteiro
2022-12-09 16:20:58 +00:00
committed by GitHub
parent fc5fe4b445
commit b56ad92e25
7 changed files with 124 additions and 0 deletions

View File

@ -474,6 +474,10 @@ pub fn eval_expression(
let lhs = eval_expression(engine_state, stack, lhs)?;
lhs.div(op_span, &rhs, op_span)?
}
Assignment::AppendAssign => {
let lhs = eval_expression(engine_state, stack, lhs)?;
lhs.append(op_span, &rhs, op_span)?
}
};
match &lhs.expr {