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

Add support for % operator in case guards #96

Merged
merged 1 commit into from
Sep 1, 2024

Conversation

giacomocavalieri
Copy link
Member

This PR closes #95

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Looks great to me! I'll leave it to one of the tree sitters folks to review and merge

================================================================================

case var {
_ if 11 % 2 == 0 -> True
Copy link
Member

Choose a reason for hiding this comment

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

what's the associativity of % - would it or *// or +/- take precedence for example in something like 11 + 1 % 2?

Copy link
Member

Choose a reason for hiding this comment

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

I believe in other languages like Rust it has the same precedence as multiplication and division so I think it's correct at 6. We can always revisit this later if expressions are sticking together incorrectly

@the-mikedavis the-mikedavis merged commit 16e775f into gleam-lang:main Sep 1, 2024
3 checks passed
@giacomocavalieri giacomocavalieri deleted the fix-95 branch October 21, 2024 14:39
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.

Syntax fails with % in pattern guards.
3 participants