From fb79318d8befa5b6015e273485021bf1de7412d1 Mon Sep 17 00:00:00 2001 From: Jen Basch Date: Tue, 22 Jul 2025 13:49:09 -0700 Subject: [PATCH] Allow trailing commas in comma-separated syntax elements --- .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 afb7ce46c..90da0a7e5 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -63,6 +63,7 @@