Skip to content

Commit de03208

Browse files
committed
Update the spec for trailing commas (SIP-27)
Fixes scala/scala-dev#299.
1 parent 5f1a638 commit de03208

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

spec/01-lexical-syntax.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,22 @@ but are required to be properly nested. Therefore, a comment like
553553
`/* /* */` will be rejected as having an unterminated
554554
comment.
555555
556+
## Multi-line and trailing commas
557+
558+
Trailing commas are allowed when followed by a newline and a closing
559+
parentheses, brackets or braces (`)`, `}`, and `]`, respectively), such as:
560+
561+
```scala
562+
foo(
563+
23,
564+
"bar",
565+
true,
566+
)
567+
```
568+
569+
This feature was added with
570+
[SIP-27](http://docs.scala-lang.org/sips/completed/trailing-commas.html).
571+
556572
## XML mode
557573
558574
In order to allow literal inclusion of XML fragments, lexical analysis

spec/15-changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ chapter: 15
66

77
# Changelog
88

9+
Changes in Version 2.12.2
10+
-------------------------
11+
12+
#### Trailing commas
13+
14+
Trailing commas when multi-line and enclosed by parentheses, brackets or braces
15+
(`)`, `}`, and `]`, respectively) are supported, via
16+
[SIP-27](http://docs.scala-lang.org/sips/completed/trailing-commas.html).
17+
918
Changes in Version 2.8.0
1019
------------------------
1120

0 commit comments

Comments
 (0)