Skip to content

Trailing comma#4138

Merged
kddnewton merged 6 commits into
mainfrom
trailing-comma
Jun 22, 2026
Merged

Trailing comma#4138
kddnewton merged 6 commits into
mainfrom
trailing-comma

Conversation

@kddnewton

Copy link
Copy Markdown
Collaborator

Fixed a couple of inconsistencies with the parse.y grammar:

  • Trailing comma on jumps at EOF — return a, / break a, / next a, are now rejected.
  • Trailing comma on parenthesized yield — yield(a,) rejected
  • Non-associativity at the same binding power — 1...2..3, a == b != c (different non-assoc operators sharing a precedence) are now rejected, not just same-token chains.
  • Trailing comma in one-line pattern matches — x => a, / foo in bar, now parse as single-element array patterns
  • Trailing comma after ... forwarding — foo(...,) rejected.
  • Trailing comma after a rest in array patterns — [a, *b,] rejected (second-rest error)

@kddnewton kddnewton merged commit 358d778 into main Jun 22, 2026
69 checks passed
@kddnewton kddnewton deleted the trailing-comma branch June 22, 2026 14:38
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.

1 participant