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

Translate pattern matching operators (in, =>) #310

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Oct 28, 2024

Motivation

Closes #133, closes #134

Those nodes are in and => operators used outside of case statements.

val in pattern
val => pattern

Test plan

See included automated tests.

@st0012 st0012 self-assigned this Oct 28, 2024
@st0012 st0012 force-pushed the translate-pattern-matching-operators branch from 8e37cf3 to bad7199 Compare October 28, 2024 14:52
@st0012 st0012 force-pushed the translate-pattern-matching-operators branch from bad7199 to 69fba23 Compare October 28, 2024 14:55
Comment on lines +26 to +28
# guards don't work outside of case-based pattern matching
# so this should be normal conditional assignment
[30, 40] => var_c, var_d if var_d == var_c*2

Choose a reason for hiding this comment

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

Good call on testing this

@amomchilov amomchilov merged commit f1e5aea into prism Oct 28, 2024
1 check passed
@amomchilov amomchilov deleted the translate-pattern-matching-operators branch October 28, 2024 15:10
@amomchilov amomchilov changed the title Translate pattern matching operators Translate pattern matching operators (in, =>) Oct 28, 2024
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.

Implement translation for PM_MATCH_REQUIRED_NODE Implement translation for PM_MATCH_PREDICATE_NODE
2 participants