Improve: extend option sequence-blank-line to let-bindings#1056
Closed
gpetiot wants to merge 4 commits intoocaml-ppx:masterfrom
gpetiot:preserve-blank-line
Closed
Improve: extend option sequence-blank-line to let-bindings#1056gpetiot wants to merge 4 commits intoocaml-ppx:masterfrom gpetiot:preserve-blank-line
gpetiot wants to merge 4 commits intoocaml-ppx:masterfrom
gpetiot:preserve-blank-line
Conversation
Julow
reviewed
Oct 8, 2019
Collaborator
Julow
left a comment
There was a problem hiding this comment.
in keywords are not counted in any location, we will need to read a token from the source file.
I couldn't find anything wrong with the locations in letops. I'll look more into it.
| in | ||
| fmt_let c ctx ~ext ~rec_flag ~bindings ~parens ~loc:pexp_loc | ||
| ~attributes:pexp_attributes ~fmt_atrs ~fmt_expr ~indent_after_in | ||
| ~blank_line_after |
Collaborator
There was a problem hiding this comment.
fmt_let has enough context to compute that itself, it should be moved there.
…extends it to let-bindings
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is WIP
Fix #1047
Few issues:
body.pexp_locofPexp_letop {let_; ands; body}is incorrect, I only checked by printing the location, the definition of letop_binding_body in parser.mly looks suspicious (should reuse more bits of let_binding_body) but I'm not really familiar enough with this code (any ideas @Julow ?)inkeyword, not a bug, but as a consequence this feature does not work if there is ainthen an empty line separating 2 definitions (hence the TO-FIX-tests)