Commit 30537e2
fix(interpreter): shift builtin now updates positional parameters (#296)
## Summary
- `shift` builtin set `_SHIFT_COUNT` marker variable but interpreter
never consumed it
- Added post-processing after builtin execution to drain positional
parameters from call frame
- Fixes infinite loop in `while [[ $# -gt 0 ]]; do case ... shift 2 ...
esac; done` pattern
## Test plan
- [x] `issue_290_while_case_shift_loop` — while/case with `shift 2`
terminates correctly
- [x] `issue_290_shift_1_default` — default `shift` (shift 1) works
Closes #290
Co-authored-by: Claude <noreply@anthropic.com>1 parent ba6feef commit 30537e2
2 files changed
+50
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3401 | 3401 | | |
3402 | 3402 | | |
3403 | 3403 | | |
| 3404 | + | |
| 3405 | + | |
| 3406 | + | |
| 3407 | + | |
| 3408 | + | |
| 3409 | + | |
| 3410 | + | |
| 3411 | + | |
| 3412 | + | |
| 3413 | + | |
| 3414 | + | |
| 3415 | + | |
3404 | 3416 | | |
3405 | 3417 | | |
3406 | 3418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
0 commit comments