Support "match only" mode in pattern compilation#421
Open
chengluyu wants to merge 16 commits intohkust-taco:hkmc2from
Open
Support "match only" mode in pattern compilation#421chengluyu wants to merge 16 commits intohkust-taco:hkmc2from
chengluyu wants to merge 16 commits intohkust-taco:hkmc2from
Conversation
# Conflicts: # hkmc2/shared/src/test/mlscript/ups/specialization/SimpleLiterals.mls
LPTK
requested changes
Mar 17, 2026
hkmc2/shared/src/main/scala/hkmc2/semantics/ups/SplitCompiler.scala
Outdated
Show resolved
Hide resolved
Co-authored-by: Lionel Parreaux <lionel.parreaux@gmail.com>
LPTK
approved these changes
Mar 21, 2026
| // When the instantiated pattern is transform-free and thus preserves the | ||
| // original scrutinee as its output, `MatchOnly` is used and the caller can | ||
| // obtain the scrutinee directly. | ||
| val canReuseScrutineeOutput = preservesScrutineeOutput(synonym, context) |
Contributor
There was a problem hiding this comment.
Shouldn't this be
Suggested change
| val canReuseScrutineeOutput = preservesScrutineeOutput(synonym, context) | |
| val canReuseScrutineeAsOutput = preservesScrutineeAsOutput(synonym, context) |
?
Comment on lines
98
to
100
| // Comments: I think the output from the compiled pattern is semantically | ||
| // correct, but people might expect the output from the translated pattern. | ||
| // The problem is that we can't synthesize a record with the class tags. |
| //│ }; | ||
| //│ end | ||
|
|
||
| :sir |
Contributor
There was a problem hiding this comment.
I think this is too much output to commit.
Contributor
There was a problem hiding this comment.
Please clean up this file: only keep one or two small, representative uses of :sir.
Contributor
There was a problem hiding this comment.
Please clean up this file: only keep one or two small, representative uses of :sir.
# Conflicts: # hkmc2/shared/src/test/mlscript/ups/MatchResult.mls
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.
No description provided.