-
Notifications
You must be signed in to change notification settings - Fork 47
[Nickel] Add support for extended patterns #705
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
Conversation
654f754 to
3548bbb
Compare
Xophmeister
left a comment
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 changes look good, but I would suggest:
@yannham Can some example code that hit your new formatting rules be added to topiary-cli/tests/samples/{input,expected}/nickel.ncl so they are tested?
@ErinvanderVeen I would cherry-pick your changes to bin/update-wasm-grammars.sh into a separate PR -- along with the updates to the non-Nickel WASM grammars -- so this PR can be more focused.
The new tests were blocked because there was an issue in the tree-sitter grammar. Yann has resolved this issue, but it still needs to merged. |
|
If I understood correctly, @ErinvanderVeen is willing to take over and to take this PR to the finish line. |
|
In fact I'm going to take over again, as this is blocking for the next Nickel release 🙂 |
Sorry 😟 |
This commit updates to the latest Nickel grammar, which includes pattern matching extensions (guards, wildcards, constants, arrays, or-patterns) and specifies their corresponding formatting rules.
042ce20 to
be73d73
Compare
No worries, it's my PR after all 🙂 @Xophmeister I ditched the WASM changes and added a few patterns to test the formatting. Let me know what you think |
|
Looks good... Let me just cherry-pick @ErinvanderVeen's commit into a separate branch before it gets lost. Also, I'll regenerate the Nickel WASM for this PR. Give me a sec, then I'll approve 👍 |
Extended patterns
This PR adds support for the last train of new pattern features in current Nickel: wildcard patterns, or-patterns, array patterns, constant patterns and pattern guards.
Description
Update to latest Nickel tree-sitter grammar and add queries to format the new constructs.
Checklist
Checklist before merging: