Skip to content

Support for mod syntax #2676

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

Merged
merged 43 commits into from
Aug 14, 2024
Merged

Conversation

liam923
Copy link
Contributor

@liam923 liam923 commented Jun 11, 2024

Allow users to write mod syntax (ex: type t : value mod global). This PR also refactors Jkind so that immediate/immediate64 is no longer a layout, but instead shorthand for value mod ....

Reviewing note: The first two commits (Promote tests that remove redundant kind from error message history and Rename Primitive to Builtin) have large, repetitive diffs. I recommend looking at them individually and then skipping them when looking at the total diff.

@liam923 liam923 requested a review from goldfirere June 11, 2024 22:06
@liam923 liam923 requested a review from Ekdohibs as a code owner June 11, 2024 22:06
Copy link
Contributor

@Ekdohibs Ekdohibs left a comment

Choose a reason for hiding this comment

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

For chamelon changes

Copy link
Collaborator

@goldfirere goldfirere left a comment

Choose a reason for hiding this comment

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

Reviewed ocaml/testsuite/tests/typing-layouts/annots.ml, just to get things started. More to come.

Copy link
Collaborator

@goldfirere goldfirere left a comment

Choose a reason for hiding this comment

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

Finished reviewing testsuite changes

@liam923 liam923 closed this Jul 5, 2024
@liam923 liam923 force-pushed the jkind-syntax-impl/testing branch from d09e34f to 4075e46 Compare July 5, 2024 20:12
@liam923 liam923 reopened this Jul 5, 2024
@liam923 liam923 marked this pull request as draft July 5, 2024 20:18
@liam923 liam923 marked this pull request as ready for review July 5, 2024 20:20
@liam923 liam923 marked this pull request as draft July 5, 2024 20:22
@liam923 liam923 mentioned this pull request Jul 8, 2024
@liam923 liam923 force-pushed the jkind-syntax-impl/testing branch 3 times, most recently from 242be4c to cfc857e Compare July 18, 2024 21:52
@liam923
Copy link
Contributor Author

liam923 commented Jul 18, 2024

The first commit, 5d4918a (Promote tests that remove redundant kind from error message history), makes the same minor change to error messages in tests in many places. I recommend reviewing that one separately from the rest of this PR so the diff is less noisy.

@liam923 liam923 force-pushed the jkind-syntax-impl/testing branch 2 times, most recently from 5fd80b2 to 9940dc2 Compare July 25, 2024 19:54
@liam923 liam923 marked this pull request as ready for review July 25, 2024 19:54
@liam923 liam923 force-pushed the jkind-syntax-impl/testing branch 2 times, most recently from 3251b32 to 948ccce Compare July 25, 2024 20:11
@liam923 liam923 force-pushed the jkind-syntax-impl/testing branch 2 times, most recently from b62260f to e21be2d Compare August 6, 2024 14:25
@liam923 liam923 force-pushed the jkind-syntax-impl/testing branch from 88bf2b9 to 1f5ca4e Compare August 13, 2024 20:43
@liam923 liam923 force-pushed the jkind-syntax-impl/testing branch from 1f5ca4e to 6c84274 Compare August 13, 2024 21:13
@liam923 liam923 merged commit 3f94a8d into ocaml-flambda:main Aug 14, 2024
16 of 17 checks passed
@liam923 liam923 deleted the jkind-syntax-impl/testing branch August 14, 2024 14:35
@ccasin ccasin mentioned this pull request Aug 31, 2024
lukemaurer pushed a commit to lukemaurer/flambda-backend that referenced this pull request Oct 23, 2024
* Promote tests that remove redundant kind from error message history

* Rename Primitive to Builtin

* Remove Const.Sort and Const.Layout aliases

* Remove pointless const definition

* Remove stale crs about eg layout_float64

* Remove legacy layout usage in printing

* Remove legacy layout usage in extension universe check

* Rename has_imported_history to is_imported

* Remove Legacy module

* Remove unused builtins

* Move const_of_user_written_annotation into Const module

* Update comment

* Remove redundant layout definition

* Remove unnecessary layout aliases

* Document jkind printing

* Rename ModeParser to Mode_parser

* Fix cr formatting

* Remove stale cr

* Remove incorrect CRs

* Replace any with abstract layout in error message

* Assert layout is value in value_kind_of_value_jkind

* Don't print : value

* Add CRs to remove annotation

* Improve debug printing

* Share parsing logic between modes and jkinds

* Simplify parsing

* Add tests

* Create test for not calling caml_modify

* Reformat files

* Add comments to caml_modify test

* Rename external_record to internal_record

* Hide external_variant's immediacy

* Add inlining test for caml_modify

* Add copyright header

* Clean up typemodifier

* Fix prining typo

* Add CR to Builtin

* Stop calling crossing of nullability mode-crossing

* Improve warning 211 message

* Restore PRs about incorrect error messages

* Cleanup typemodifier more

* Fix bug in required maturity level for modes

* Fix floatarray kind and promote tests
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