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

Allow patterns in use expressions #49

Merged
merged 1 commit into from
Mar 3, 2023
Merged

Allow patterns in use expressions #49

merged 1 commit into from
Mar 3, 2023

Conversation

the-mikedavis
Copy link
Member

Closes #47

optional(series_of($.identifier, ",")),
optional(series_of($._pattern, ",")),
Copy link
Member Author

Choose a reason for hiding this comment

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

Are multiple (or zero) comma-separated patterns allowed with use or was that just for identifiers?

Copy link
Member

@J3RN J3RN Mar 3, 2023

Choose a reason for hiding this comment

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

Multiple patterns are allowed, so your code is correct. For posterity, the relevant line is this one:

https://github.com/gleam-lang/gleam/blob/fe6dcf49a3d7787d81c8a0d32419a24b7e3ee36a/compiler-core/src/parse.rs#L723

Copy link
Member

@J3RN J3RN left a comment

Choose a reason for hiding this comment

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

Thanks for this, @the-mikedavis! 🎆

@J3RN J3RN merged commit 7bfdc49 into gleam-lang:main Mar 3, 2023
@the-mikedavis the-mikedavis deleted the md-use-patterns branch March 3, 2023 05:44
@inoas
Copy link
Contributor

inoas commented Mar 3, 2023

Thank you!

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.

use expressions now support patterns
3 participants