Skip to content
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

Add support for trailing commas in tuples #923

Merged
merged 1 commit into from
Dec 29, 2016

Conversation

IwanKaramazow
Copy link
Contributor

Implements #889

This does not print trailing commas when line breaks are needed.
I think this requires an enhancement in the EasyFormat lib.

@SanderSpies
Copy link
Contributor

LGTM

@yunxing
Copy link
Contributor

yunxing commented Dec 29, 2016

Yes, we need more options in EasyFormat in order to do this. cc @pieterv who has the same requirement.

@yunxing
Copy link
Contributor

yunxing commented Dec 29, 2016

Thanks!

@yunxing yunxing merged commit b7afac5 into reasonml:master Dec 29, 2016
@pieterv
Copy link

pieterv commented Dec 29, 2016

@yunxing yes i believe this requires a change to EasyFormat (see ocaml-community/easy-format#11). I did manage to implement a hack (as suggested by @jordwalke) where we insert a token in places we potental want trailing commas and then after printing from EasyFormat to string we find the instances of the token followed by a "\n" and replace with ",\n" otherwise strip it. Its working well so far although can mess with the indentation a little since you remove chars after doing all the breaking.

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.

5 participants