这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@mdelvecchio-jsc
Copy link

Add support for unboxed tuples to ocamlformat. Formatting aligns as directly as possible with formatting of regular tuples, except that parentheses are always required, and some aligning needs to be adjusted to account for the extra '#' character.

Testing: Transformed every tuple in jane to an unboxed tuple, and ran ocamlformat on the entire tree successfully. Additionally skimmed the diff, and saw that formatting was reasonable. Added a test file: copied the existing tests for labeled tuples and adjusted it a bit, with some additional regression tests at the bottom.

@mdelvecchio-jsc mdelvecchio-jsc requested a review from ccasin May 30, 2024 16:06
@mdelvecchio-jsc mdelvecchio-jsc force-pushed the tdelvecchio-unboxed-tuples branch from d154c6a to 9fc13f3 Compare May 30, 2024 16:08
Copy link

@ccasin ccasin left a comment

Choose a reason for hiding this comment

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

This looks pretty good! A few questions/suggestions.

@mdelvecchio-jsc mdelvecchio-jsc force-pushed the tdelvecchio-unboxed-tuples branch from 4f24ce1 to 25fb747 Compare May 31, 2024 18:49
Copy link

@ccasin ccasin left a comment

Choose a reason for hiding this comment

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

Looks good - thanks for the explanations. I'll let you decide when is the right time to merge this. Unboxed tuples in the compiler are still a couple weeks out.

@mdelvecchio-jsc mdelvecchio-jsc force-pushed the tdelvecchio-unboxed-tuples branch from 25fb747 to bc4a43a Compare June 18, 2024 14:42
Signed-off-by: Thomas Del Vecchio <tdelvecchio@janestreet.com>

Initial attempt.

Signed-off-by: Thomas Del Vecchio <tdelvecchio@janestreet.com>

Update tests.

Signed-off-by: Thomas Del Vecchio <tdelvecchio@janestreet.com>

Formatting

Signed-off-by: Thomas Del Vecchio <tdelvecchio@janestreet.com>

Formatting.

Signed-off-by: Thomas Del Vecchio <tdelvecchio@janestreet.com>

Fix ups

Signed-off-by: Thomas Del Vecchio <tdelvecchio@janestreet.com>

Updated tests.

Signed-off-by: Thomas Del Vecchio <tdelvecchio@janestreet.com>

Fix up mapper.

Signed-off-by: Thomas Del Vecchio <tdelvecchio@janestreet.com>

Fix paren of last element of tuple.

Signed-off-by: Thomas Del Vecchio <tdelvecchio@janestreet.com>

Factor out code.

Signed-off-by: Thomas Del Vecchio <tdelvecchio@janestreet.com>

Fixups.

Signed-off-by: Thomas Del Vecchio <tdelvecchio@janestreet.com>

Add test demonstrating behavior in special case.

Signed-off-by: Thomas Del Vecchio <tdelvecchio@janestreet.com>

Add more tests.

Signed-off-by: Thomas Del Vecchio <tdelvecchio@janestreet.com>
@mdelvecchio-jsc mdelvecchio-jsc force-pushed the tdelvecchio-unboxed-tuples branch from bc4a43a to a0e59ad Compare June 18, 2024 17:32
@mdelvecchio-jsc mdelvecchio-jsc merged commit 2d28e18 into jane Jun 18, 2024
mdelvecchio-jsc added a commit that referenced this pull request Jun 18, 2024
Signed-off-by: Thomas Del Vecchio <tdelvecchio@janestreet.com>
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.

3 participants