Skip to content

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

Merged
merged 11 commits into from
Nov 25, 2016
Merged

SIP-27: Trailing Commas, revised document #625

merged 11 commits into from
Nov 25, 2016

Conversation

dwijnand
Copy link
Member

No description provided.

@dwijnand
Copy link
Member Author

The move back to pending is postponed to ease review as GitHub didn't recognize it as a file rename.

@dwijnand
Copy link
Member Author

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.
@dwijnand
Copy link
Member Author

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.

@jvican
Copy link
Member

jvican commented Nov 21, 2016

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

Copy link
Contributor

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?

Copy link
Member Author

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
Copy link
Contributor

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:
Copy link
Contributor

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?

Copy link
Member Author

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`.
Copy link
Contributor

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][].
Copy link
Contributor

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.`?

@jvican
Copy link
Member

jvican commented Nov 24, 2016

@dwijnand Let me know when you're done with all the changes, and I will merge it.

@dwijnand
Copy link
Member Author

Thank you @xeno-by for the review, see my pushed changes.

@jvican Let's merge either tomorrow or when @xeno-by approves, which ever comes first. Thanks.

@xeno-by
Copy link
Contributor

xeno-by commented Nov 25, 2016

LGTM

@jvican jvican merged commit 4181d9f into scala:master Nov 25, 2016
@dwijnand dwijnand deleted the traily branch November 25, 2016 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants