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

parser/pprint_ast: force parentheses around switch (...)/try (...) #1720

Merged
merged 1 commit into from
Jan 6, 2018
Merged

parser/pprint_ast: force parentheses around switch (...)/try (...) #1720

merged 1 commit into from
Jan 6, 2018

Conversation

let-def
Copy link
Contributor

@let-def let-def commented Dec 23, 2017

This PR force scrutinees in switch and try expressions to be wrapped with parentheses: switch (a) { | None => ... }.

@chenglou
Copy link
Member

chenglou commented Dec 23, 2017

That was fast. Thanks! Is it possible to only do the printing change for now? This way after folks all refmt their files we can release the parser change, which wouldn't break (many) things

@jordwalke
Copy link
Member

How does this change the parsing of switching on tuples?

@let-def
Copy link
Contributor Author

let-def commented Dec 28, 2017

It doesn't change: switch (a,b) { | (Some(one), Some(body)) => ... }

Copy link
Member

@jordwalke jordwalke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@jordwalke jordwalke merged commit 03e2564 into reasonml:master Jan 6, 2018
chenglou added a commit that referenced this pull request Jan 6, 2018
See #1720 (comment)

This way of printing with parens while parsing both lets userland
gradually use the enforced parens syntax without breaking their app
(especially, and mainly, if they have third-party dependencies).

We'll re-revert this patch in the future.
chenglou added a commit that referenced this pull request Jan 6, 2018
See #1720 (comment)

This way of printing with parens while parsing both lets userland
gradually use the enforced parens syntax without breaking their app
(especially, and mainly, if they have third-party dependencies).

We'll re-revert this patch in the future.
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