-
Notifications
You must be signed in to change notification settings - Fork 0
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
Multiway match typechecking and translation for pattern guards #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The translcore changes are trickier than I thought, but they still seem fine. I left a few mostly-minor comments.
e9f2f13
to
afa084b
Compare
8e2d188
to
92d3138
Compare
As discussed, rebased onto test changes in other PRs to consolidate tests before restructuring and splitting test cases into different test files. |
afa084b
to
7e4b140
Compare
4a392f5
to
4e9a6c1
Compare
Rebase onto new parsing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few fairly minor suggestions.
4e9a6c1
to
bc3dd1b
Compare
e3d7c76
to
4e22f63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will be good to merge after it's rebased and any conflicts are resolved. As discussed, we'll need to open a new PR from multiway-match-parsing
into the flambda-backend repo even after this is merged.
Co-authored-by: Nick Roberts <[email protected]>
bc3dd1b
to
3f8864d
Compare
* multiway typechecking and translation * update jane test output * self-review: format and style in translcore * more translcore/typedtree cleanup * expose value `is_guarded_rhs` * fix typedtree printer * make discussed changes to ocamldoc * format: remove unnecessary parens in pattern Co-authored-by: Nick Roberts <[email protected]> * improve parmatch variable naming * explain [exp_attributes] and [exp_extra] weirdness * improve translcore [event_function*] naming * inlined transl_body in transl_rhs * rename pats_exp... to use "rhs" naming * added test for guarded value/exception or-patterns * address ocamldoc CRs --------- Co-authored-by: Nick Roberts <[email protected]>
Multiway match typechecking and translation for pattern guards (#2) * multiway typechecking and translation * update jane test output * self-review: format and style in translcore * more translcore/typedtree cleanup * expose value `is_guarded_rhs` * fix typedtree printer * make discussed changes to ocamldoc * format: remove unnecessary parens in pattern * improve parmatch variable naming * explain [exp_attributes] and [exp_extra] weirdness * improve translcore [event_function*] naming * inlined transl_body in transl_rhs * rename pats_exp... to use "rhs" naming * added test for guarded value/exception or-patterns * address ocamldoc CRs --------- Co-authored-by: Nick Roberts <[email protected]>
Multiway match typechecking and translation for pattern guards (#2) * multiway typechecking and translation * update jane test output * self-review: format and style in translcore * more translcore/typedtree cleanup * expose value `is_guarded_rhs` * fix typedtree printer * make discussed changes to ocamldoc * format: remove unnecessary parens in pattern * improve parmatch variable naming * explain [exp_attributes] and [exp_extra] weirdness * improve translcore [event_function*] naming * inlined transl_body in transl_rhs * rename pats_exp... to use "rhs" naming * added test for guarded value/exception or-patterns * address ocamldoc CRs --------- Co-authored-by: Nick Roberts <[email protected]>
Implements typechecking and translation for pattern guards.
The changes are mostly the straightforward generalization of the single case pattern guard construct.
The main complexity comes from changes related to the restructuring of
Typedtree.case
, whose fieldc_rhs
used to be of typeexpression
, but is now of typecase_rhs
, in conjunction with the way that multiway pattern guards change the notion of the rhs of a case.The changes in ocamldoc are type-directed, but it is not apparent that they exhibit the intended behavior. It is worth trying to figure out the intended behavior of the modified functions through review.