From ae5f02b285fd3f0e209220d9cf707ecd30587653 Mon Sep 17 00:00:00 2001 From: Jen Basch <421772+HT154@users.noreply.github.com> Date: Thu, 21 Aug 2025 06:43:38 -0700 Subject: [PATCH] Allow trailing commas in comma-separated syntax elements (#1137) --- .idea/codeStyles/Project.xml | 1 + .../input/parser/constraintsTrailingComma.pkl | 9 + .../input/parser/lambdaTrailingCommas.pkl | 43 +++++ .../input/parser/methodTrailingCommas.pkl | 157 ++++++++++++++++++ .../input/parser/trailingCommas.pkl | 3 + .../parser/constraintsTrailingComma.pcf | 3 + .../output/parser/methodTrailingCommas.pcf | 36 ++++ .../output/parser/trailingCommas.pcf | 3 + .../org/pkl/core/parser/TrailingCommasTest.kt | 82 +++++++++ .../src/main/java/org/pkl/parser/Parser.java | 46 +++-- 10 files changed, 370 insertions(+), 13 deletions(-) create mode 100644 pkl-core/src/test/files/LanguageSnippetTests/input/parser/constraintsTrailingComma.pkl create mode 100644 pkl-core/src/test/files/LanguageSnippetTests/input/parser/lambdaTrailingCommas.pkl create mode 100644 pkl-core/src/test/files/LanguageSnippetTests/input/parser/methodTrailingCommas.pkl create mode 100644 pkl-core/src/test/files/LanguageSnippetTests/input/parser/trailingCommas.pkl create mode 100644 pkl-core/src/test/files/LanguageSnippetTests/output/parser/constraintsTrailingComma.pcf create mode 100644 pkl-core/src/test/files/LanguageSnippetTests/output/parser/methodTrailingCommas.pcf create mode 100644 pkl-core/src/test/files/LanguageSnippetTests/output/parser/trailingCommas.pcf create mode 100644 pkl-core/src/test/kotlin/org/pkl/core/parser/TrailingCommasTest.kt diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index afb7ce46..90da0a7e 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -63,6 +63,7 @@