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

Represent the expr sequence as a list #2533

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gpetiot
Copy link
Collaborator

@gpetiot gpetiot commented Mar 5, 2024

Not urgent, but it cleans up a lot of stuff in sugar/ast about sequences.

The diff is caused by:

  • comments attached after the sequence were moved to after the last element, I'm not sure we should continue to do that, to me the diff looks better on this
  • the special case added by Josh about adding a break before the semicolon that follows a debug/trace call, this has been factorized with the rest, with a match on the extension name. Not sure how much people would complain if we removed it? We can also only apply that for the profile = ocamlformat case, or just remove it.

@gpetiot gpetiot requested a review from Julow March 5, 2024 11:21
Copy link
Collaborator

@Julow Julow left a comment

Choose a reason for hiding this comment

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

I love this! This removes a lot of tricky code.

the special case added by Josh about adding a break before the semicolon that follows a debug/trace call, this has been factorized with the rest, with a match on the extension name.

It would be nice to have a test case for this. I think it's fair to remove it otherwise.

test-branch finds a similar case in irmin but with [%log.debug], the semicolon was broken before so it seems that the rule was more general.

Also, this might remove some rewriting that were done before, like removing parentheses around sub sequences, rewriting extensions into a shorter form. It would be nice to show the change in the tests.

@gpetiot
Copy link
Collaborator Author

gpetiot commented Mar 8, 2024

There is already a test of the facebook trace calls: test/passing/tests/pre_post_extensions.ml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants