mirror of
https://github.com/apple/pkl.git
synced 2026-01-13 23:23:37 +01:00
Allow trailing commas in comma-separated syntax elements #319
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @HT154 on GitHub (Jul 21, 2025).
Many languages—Swift included—allow trailing commas between comma-separated syntax elements.
Allowing this means that adding elements to the end or reordering elements doesn't incur additional diff to manage the comma absence on the new/former final element.
These syntax rules in Pkl should allow trailing commas:
Pkl's formatter should likely enforce trailing commas are present when the containing syntax rules are broken over multiple lines.
This will require support in Pkl's various grammars (pkl-intellij, tree-sitter-pkl).
This should probably also affect the
pkl.experimental.syntaxlibrary in pkl-pantry.