Commit 2928e36
authored
fix(interpreter): handle compound array assignment in local builtin (#888)
## Summary
- `local arr=(one two three)` produced an empty array because compound
assignment syntax `=(...)` was only recognized when `-a` or `-A` flags
were present
- Detect `=(...)` syntax regardless of flags in both function-scope and
global-scope paths
- Also handle global-scope `local` with compound assoc array assignments
- Unskip `nameref_local_dynamic_scope` test that depended on this fix
(22 skipped, down from 23)
## Test plan
- [x] New spec tests `local_array_compound_assignment` and
`local_array_compound_in_global` pass
- [x] Previously skipped `nameref_local_dynamic_scope` now passes
- [x] All 1812 bash spec tests pass (100%, 22 skipped)
- [x] Full `cargo test --all-features` passes
- [x] `cargo fmt --check` and `cargo clippy` clean
Closes #8771 parent b2e6d88 commit 2928e36
File tree
4 files changed
+76
-10
lines changed- crates/bashkit
- src/interpreter
- tests
- spec_cases/bash
4 files changed
+76
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4425 | 4425 | | |
4426 | 4426 | | |
4427 | 4427 | | |
4428 | | - | |
4429 | | - | |
4430 | | - | |
4431 | | - | |
4432 | | - | |
| 4428 | + | |
| 4429 | + | |
| 4430 | + | |
4433 | 4431 | | |
4434 | 4432 | | |
4435 | 4433 | | |
| |||
4538 | 4536 | | |
4539 | 4537 | | |
4540 | 4538 | | |
4541 | | - | |
| 4539 | + | |
| 4540 | + | |
| 4541 | + | |
| 4542 | + | |
| 4543 | + | |
| 4544 | + | |
| 4545 | + | |
| 4546 | + | |
| 4547 | + | |
| 4548 | + | |
| 4549 | + | |
| 4550 | + | |
| 4551 | + | |
| 4552 | + | |
| 4553 | + | |
| 4554 | + | |
| 4555 | + | |
| 4556 | + | |
| 4557 | + | |
| 4558 | + | |
| 4559 | + | |
| 4560 | + | |
| 4561 | + | |
| 4562 | + | |
| 4563 | + | |
| 4564 | + | |
| 4565 | + | |
| 4566 | + | |
| 4567 | + | |
| 4568 | + | |
| 4569 | + | |
| 4570 | + | |
| 4571 | + | |
| 4572 | + | |
| 4573 | + | |
| 4574 | + | |
| 4575 | + | |
| 4576 | + | |
| 4577 | + | |
| 4578 | + | |
| 4579 | + | |
| 4580 | + | |
| 4581 | + | |
| 4582 | + | |
| 4583 | + | |
| 4584 | + | |
| 4585 | + | |
| 4586 | + | |
4542 | 4587 | | |
4543 | 4588 | | |
4544 | 4589 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | 27 | | |
30 | 28 | | |
31 | 29 | | |
| |||
0 commit comments