-
Notifications
You must be signed in to change notification settings - Fork 1k
SIP-27: Trailing Commas, revised document #625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The move back to pending is postponed to ease review as GitHub didn't recognize it as a file rename. |
Review by @xeno-by if possible, please |
.. for those who don't want to re-read the whole document but instead want to see the diff of what changed.
The next SIP meeting is next week Tuesday (29th). If this doesn't get any review, I'm keen to get it merged some time before the meeting to give the committee members a nicely rendered, updated version of the document. If it were up to me I'd say give it another day and merge it tomorrow if nothing changes, leaving a week for pre-meeting review/study. Thanks. |
I agree with the suggestion. Will merge tomorrow if people in the Community don't have anything else to say 😄. |
vote-text: The following proposal needs to be updated, since only the specialized case version (with new lines) has been accepted. For more information, check the <a href="http://docs.scala-lang.org/sips/minutes/sip-20th-september-minutes.html">minutes</a>. | ||
--- | ||
|
||
// TODO: Move from sips/completed to sips/pending | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to leave the TODO here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm removing the TODO and moving the document in #631, which can be merged after this is merged.
bar, | ||
) | ||
) // error: illegal start of simple expression | ||
{% endhighlight %} | ||
|
||
### Reduce diff noise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be "Diff noise reduction" to be consistent with other section titles?
There are a number of different elements of the Scala syntax that are comma separated, but instead of changing them all a subset of the more useful ones was chosen: | ||
### Multi-line | ||
|
||
It is not the intent of introducing trailing commas to promote a code style such as: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you briefly explain why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done d1ebb53
|
||
From the spec these are: | ||
2. The second variant adds trailing comma support to the whole grammar (again, only for multi-line), which means more consistency, but also supporting trailing commas in places that doesn't really need it, such as `ids`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by "doesn't really need it"?
|
||
## Implementation | ||
|
||
The implementation is a simple change to the parser, allowing for a trailing comma, for the groups detailed above, and has been proposed in [scala/scala#5245][]. | ||
The implementation of trailing commas is a matter of changing some of the implementation of Scala's parser. An implementation of this proposal can be found at [scala/scala#5245][]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about "is limited to changing Parsers.scala
in the Scala compiler.`?
@dwijnand Let me know when you're done with all the changes, and I will merge it. |
LGTM |
No description provided.