Skip to content

parser: extglob-ON compound assignment elements still rejected (arr=(@(foo|bar)) with shopt -s extglob) #389

Closed

Description

@caomengxuan666

Found during wt33 triage of #373. Real semantic gap (the extglob-off rejection is correct and GNU-identical; the ON case is missing).

Repro (script file, both shells)

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

shopt -s extglob
arr=(@(foo|bar) [name]=+(test|bench))
declare -p arr
arr2=("{a,b}" '@(x|y)' {c,d} @(one|two))
declare -p arr2

WSL GNU Bash 5.3.0:

declare -a arr=([0]="+(test|bench)")
declare -a arr2=([0]="{a,b}" [1]="@(x|y)" [2]="c" [3]="d" [4]="@(one|two)")
rc 0

rubash:

stderr: <script>: line 2: syntax error near unexpected token `(`
        <script>: line 3: declare: arr: not found
rc 1

Notes

  • extglob OFF: both shells reject arr=(@(foo|bar) ...) byte-identically (probe C01/C02) — that part is correct.
  • With extglob ON the PARSE_EXTENDED_GLOB gate (src/lexer, mirroring GNU parse.y:5466) apparently does not reach the compound-assignment element scan (parser/token_actions.rs atomic name=(...) path).
  • Raw artifacts: target/issue-suites/results/wt33-373/run/C0{1,2,3}_*.
  • tests/parser_tests.rs test_compound_assignment_records_extglob_elements / ..._ignores_quoted_brace_and_extglob_elements now assert the GNU-identical extglob-OFF parse error; the ON admission is tracked here.

Activity

  1. added
    bug
    on Oct 2, 2026
  2. added a commit that references 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/issue389_*_regressions.rs and the lane's two-shell matrices on the ticket trail. Master carries the fix; suites green.

  4. added a commit that references this issue on Oct 2, 2026
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