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 &| and 2>| in pipes #20

Closed
piechologist opened this issue Mar 23, 2024 · 2 comments · Fixed by #21
Closed

Allow &| and 2>| in pipes #20

piechologist opened this issue Mar 23, 2024 · 2 comments · Fixed by #21

Comments

@piechologist
Copy link
Contributor

piechologist commented Mar 23, 2024

Is it possible to add &| and 2>| as pipe operators? I'm thinking of something like:

pipe: $ => prec.left(seq($._statement, choice('&|', '2>|', '|'), $._statement)),

I'm new to tree-sitter and I'm not sure if this may cause any side effects.

For reference: convenience operators in the fish docs

@taekwombo
Copy link
Contributor

Yeah, just add the other alternatives to | here: https://github.com/ram02z/tree-sitter-fish/blob/master/grammar.ts#L87 just like you wrote.
And two more test cases here https://github.com/ram02z/tree-sitter-fish/blob/master/test/corpus/pipe.txt

@piechologist
Copy link
Contributor Author

Works like a charm locally in the Zed editor. See PR #21.

Let me know if I should make changes. Cheers!

@ram02z ram02z closed this as completed in #21 Apr 2, 2024
ram02z pushed a commit that referenced this issue Apr 2, 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 a pull request may close this issue.

2 participants