Skip to content

parser: extglob-off parse gate missing for select/for word lists (GNU rejects select x in a @(b|c)) #386

Closed

Description

@caomengxuan666

Found during wt33 triage of #373. Real semantic gap.

Repro (script file, both shells)

target/issue-suites/results/wt33-373/cases/B08_select_extglob_off.sh:

select x in a @(b|c); do :; done < /dev/null
echo rc=$?

WSL GNU Bash 5.3.0 (extglob off, the default):

stderr: <script>: line 1: syntax error near unexpected token `(`
        <script>: line 1: `select x in a @(b|c); do :; done < /dev/null`
rc 2

rubash:

stdout: |rc=1|  plus the select menu listing `1) a 2) @ 3) ( 4) b 5) c 6) ) 7) ~+/bin` twice (stdin EOF)
stderr: menu prompt text
rc 0 for the script; select exits 1

i.e. rubash accepts @(b|c) in the select word list and splits it into menu items.

Notes

  • Simple-command position IS gated correctly (echo @(alpha|beta) errors on both shells, probe A04), and so is assignment position (A05) — the gate (src/lexer PARSE_EXTENDED_GLOB, mirroring GNU parse.y:5466 extended_glob && PATTERN_CHAR) just does not cover the select/for word-list parse path.
  • Raw artifacts: target/issue-suites/results/wt33-373/run/B08_select_extglob_off.*, A23_select_extglob.*.
  • tests/parser_tests.rs test_for_and_select_words_record_metadata now enables extglob first (matching GNU parse-execute cadence); the off-gate divergence is tracked here.

Activity

  1. added
    bug
    on Oct 2, 2026
  2. added 2 commits that reference this issue on Oct 2, 2026
  3. caomengxuan666 commented on Oct 2, 2026

    @caomengxuan666
    MemberAuthor

    Landed on master (wt37/gapfix1 batch, CI green on bbccb1c): see the issue-suite tests/issue386_*_regressions.rs and the lane's two-shell matrices on the ticket trail. Master carries the fix; suites green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions