You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found by the wt25/semix lane while fixing #372 (reverse divergence: GNU strict, rubash lax).
Shape
case x in
esac) echo hi;;
esac
WSL GNU Bash 5.3.0: syntax error near unexpected token ')' — an esac immediately following in is the ESAC token (empty case body), so the ) is stray.
rubash (current master): silently accepts and runs.
Root pointer (lane's analysis)
parse_case_command's empty-case check does not skip the newline(s) after in before deciding the body is empty, so the following esac) gets consumed as if a pattern were allowed. GNU owner: the case-clause reader in parse.y (case_clause/case_item sequence; in then NEWLINE then ESAC closes the case at the grammar level — a ) after that is a stray token error).
Fix-lane notes
Small, but it is a strictness divergence (we accept scripts GNU rejects) — worth pinning with a both-directions regression: case x in\nesac) (error) vs case x in\n(esac) (pattern esac, valid) vs case x in esac) on one line.
Landed as 600cf42 (wt29/rubugs lane a3851274). parse_case_command's empty-case check now skips the newline_list after in (parse.y:1037) before testing for esac; a stray )/( there reports RUBASH_PARSE_ERROR_NEAR exactly like GNU's syntax error near unexpected token )`` (| stays a legal pipe, reported at the trailing `)`). Both-directions matrix 13/14 byte-identical (residual: comsub-wrapped form's source-line echo attribution, pre-existing). issue381 suite 7/7. CI green.
Activity
docs: wt25/semix recovery (#371/#372 closed, #380/#381 opened)
fix(#381): empty-case strictness — stray delimiter after `in' newline…
caomengxuan666 commentedon Oct 1, 2026
Landed as 600cf42 (wt29/rubugs lane a3851274). parse_case_command's empty-case check now skips the newline_list after
in(parse.y:1037) before testing for esac; a stray)/(there reports RUBASH_PARSE_ERROR_NEAR exactly like GNU'ssyntax error near unexpected token)`` (|stays a legal pipe, reported at the trailing `)`). Both-directions matrix 13/14 byte-identical (residual: comsub-wrapped form's source-line echo attribution, pre-existing). issue381 suite 7/7. CI green.fix: top-level unclosed procsub continuation, [ ( diagnostic token, b…
fix(parser): procsub source reprint keeps `;` before closers and at b…
WIP: coproc/procsub residual reconciliation (wave 3) (#1866)