Skip to content

parse-error wording/rc divergences vs GNU 5.3.0 (4 focused cases from wt33 sweep) #390

Closed

Description

@caomengxuan666

Found during wt33 triage of #373. Real but narrow divergences in parse-error MESSAGE TEXT (and rc for the first two). All reproductions are script-file probes under target/issue-suites/results/wt33-373/run/ (runner run_cases.sh); same-named .gnu/.rub files hold both shells' stdout/stderr/rc.

  1. Unclosed arithmetic subscript — ((X=([))] (B11):

    • GNU: unexpected EOF while looking for matching \)'`, rc 1
    • rubash: line 3: syntax error: unexpected end of file from \(' command on line 1`, rc 2
  2. Escaped-quote array subscript, secondary error — a[\\" \\"]=15 + follow-up line (A07):

    • GNU second diagnostic: unexpected EOF while looking for matching \"'`
    • rubash: unexpected EOF while looking for matching \]'`
      (the first diagnostic and rc=1 for the arithmetic failure itself are byte-identical, see B10)
  3. Subshell + stray esac delimiter — ( case esac in\nesac) printf matched ;; esac ) (B12):

    • GNU: syntax error near unexpected token \printf'`
    • rubash: syntax error near unexpected token \)'`
      (both rc 2 — rejection itself is correct per rubash#381)
  4. Case alternation with bare esac — case esac in esac|fi) ... (E02):

    • GNU names the offending token `fi'
    • rubash names `)'
      (both rc 2)

Tests touching these keep asserting the shared invariant (error present, no tail-command leak) and reference this issue for the wording deltas.

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

    Analysis complete (wt37/gapfix1, artifacts target/issue-suites/results/wt37-gapfix1/issue390-391-analysis.txt + issue390-probes/): q3/q4 need the esacs_needed_count bookkeeping port plus the yacc error-recovery naming chain — GNU rule boundary mapped (case x in fi) legal, case x in esac) errors at the ), only |/(-preceded esac is exempt); q1/q2 are combined-error rc attribution (the single-shot EOF family is already GNU-correct on master). Scope is a focused lane; picking up next wave.

  4. added 2 commits that reference this issue on Oct 2, 2026
  5. caomengxuan666 commented on Oct 2, 2026

    @caomengxuan666
    MemberAuthor

    Landed as two commits on master (CI green d47cef6): all four probe families fixed with the full GNU citation chain (parse.y:3726-3733 read_token \→parse_dparen, 4925-4950 nested-subshell reinterpretation, 3908-3915 matched-pair EOF wording with start_lineno, 7140-7174 compound-assignment rc=1, 3168-3209 CHECK_FOR_RESERVED_WORD with the |/( exemptions and ESAC closure, esacs_needed_count accounting). Notable reclassification found while fixing: ((x=[y)) / ((a[b)) take the P_ARITH data branch — the evaluator reports rc 1 where rubash used to rc-2 reject. 109/113 matrix byte-identical; issue390 suite 9/9; true-baseline extglob/array/assoc/case/errors slices byte-identical. The 4 matrix-expansion residuals filed as follow-ups.

  6. added 3 commits that reference 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