Skip to content

feat(for): implement positional params iteration in for loops#125

Merged
chaliy merged 3 commits intomainfrom
claude/fix-todos-LmNzD
Feb 4, 2026
Merged

feat(for): implement positional params iteration in for loops#125
chaliy merged 3 commits intomainfrom
claude/fix-todos-LmNzD

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 4, 2026

Summary

  • Implement for x; do ... done syntax to iterate over positional parameters ($@) inside functions
  • Fix parser to consume optional semicolon between variable name and do keyword

Test plan

  • Added test_for_loop_positional_params test
  • Ran cargo test -p bashkit --lib --all-features - 603 tests pass
  • Ran cargo fmt --check && cargo clippy --all-targets --all-features -- -D warnings

https://claude.ai/code/session_01DsjxPUzxwySRqnkfRroawu

When a for loop has no 'in' clause (e.g., `for x; do echo $x; done`),
iterate over positional parameters ($@) from the current call frame.

Also fix parser to consume optional semicolon between variable and 'do'.

https://claude.ai/code/session_01DsjxPUzxwySRqnkfRroawu
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

The parser now correctly handles "done" as regular word after for loop.

https://claude.ai/code/session_01DsjxPUzxwySRqnkfRroawu
- Add bracket expression matching in glob patterns for case statements
- Implement character ranges (a-z), negation ([!x] and [^x])
- Update lexer to read [abc] as single word token instead of separate tokens
- Add tests for bracket expressions, ranges, and negation

https://claude.ai/code/session_01DsjxPUzxwySRqnkfRroawu
@chaliy chaliy merged commit 2e46e08 into main Feb 4, 2026
8 checks passed
@chaliy chaliy deleted the claude/fix-todos-LmNzD branch February 4, 2026 02:07
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.

2 participants