Skip to content

fix(interpreter): shift builtin now updates positional parameters#296

Merged
chaliy merged 1 commit intomainfrom
claude/issue-290-shift-positional-76a2F
Feb 26, 2026
Merged

fix(interpreter): shift builtin now updates positional parameters#296
chaliy merged 1 commit intomainfrom
claude/issue-290-shift-positional-76a2F

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Feb 26, 2026

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

  • issue_290_while_case_shift_loop — while/case with shift 2 terminates correctly
  • issue_290_shift_1_default — default shift (shift 1) works

Closes #290

@chaliy chaliy merged commit 30537e2 into main Feb 26, 2026
16 checks passed
@chaliy chaliy deleted the claude/issue-290-shift-positional-76a2F branch March 12, 2026 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: while/case arg parsing hits MaxLoopIterations for 5-iteration loop

2 participants