Skip to content

feat(bash): case ;& and ;;& fallthrough/continue-matching#249

Merged
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD
Feb 24, 2026
Merged

feat(bash): case ;& and ;;& fallthrough/continue-matching#249
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 24, 2026

Summary

  • Add DoubleSemicolon, SemiAmp, and DoubleSemiAmp tokens to the lexer for proper case terminator parsing
  • Parse case terminators into CaseTerminator enum: Break (;;), FallThrough (;&), Continue (;;&)
  • ;& falls through to next case body unconditionally (without pattern check)
  • ;;& continues checking remaining case patterns

Previously ;& and ;;& caused parser fuel exhaustion (infinite loop).

Test plan

  • 5 new spec tests: fallthrough, chain, continue-matching, continue-skip, and unconditional fallthrough
  • All 1214 spec tests pass (1209 pass, 5 skip)
  • cargo clippy and cargo fmt clean
  • Existing case tests (;;) still pass

Add DoubleSemicolon, SemiAmp, and DoubleSemiAmp tokens to the lexer.
Parse case terminators into CaseTerminator enum (Break, FallThrough,
Continue). Interpreter executes next case body on ;& without pattern
check, or continues checking remaining patterns on ;;&.

Add 5 spec tests for case fallthrough scenarios.
@chaliy chaliy merged commit 2d5b74e into main Feb 24, 2026
16 checks passed
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