mirror of
https://github.com/apple/pkl.git
synced 2026-01-11 14:20:35 +01:00
[PR #1137] [MERGED] SPICE-0019: Allow trailing commas in comma-separated syntax elements #909
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?
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/1137
Author: @HT154
Created: 7/22/2025
Status: ✅ Merged
Merged: 8/21/2025
Merged by: @bioball
Base:
main← Head:trailing-commas📝 Commits (1)
fb79318Allow trailing commas in comma-separated syntax elements📊 Changes
10 files changed (+370 additions, -13 deletions)
View changed files
📝
.idea/codeStyles/Project.xml(+1 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/input/parser/constraintsTrailingComma.pkl(+9 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/input/parser/lambdaTrailingCommas.pkl(+43 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/input/parser/methodTrailingCommas.pkl(+157 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/input/parser/trailingCommas.pkl(+3 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/output/parser/constraintsTrailingComma.pcf(+3 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/output/parser/methodTrailingCommas.pcf(+36 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/output/parser/trailingCommas.pcf(+3 -0)➕
pkl-core/src/test/kotlin/org/pkl/core/parser/TrailingCommasTest.kt(+82 -0)📝
pkl-parser/src/main/java/org/pkl/parser/Parser.java(+33 -13)📄 Description
Implements https://github.com/apple/pkl-evolution/pull/21
This changes Pkl's grammar but is not breaking. It only admits inputs that were previously invalid.
Covers these syntax elements:
parser/methodTrailingCommas.pklparser/methodTrailingCommas.pklparser/trailingCommas.pklparser/trailingCommas.pklparser/constraintsTrailingComma.pklparser/lambdaTrailingCommas.pklparser/lambdaTrailingCommas.pklResolves #1132
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.