Skip to content

add pipe operator #85

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

q60
Copy link

@q60 q60 commented Sep 14, 2024

it works but help needed, i'm in love/hate relationships with tree-sitter specifically and parsers in general
image

@qm3ster
Copy link

qm3ster commented Mar 3, 2025

Should probably have the left pipe as well?

@q60
Copy link
Author

q60 commented Mar 3, 2025

@qm3ster i'm still waiting for some kind of review/approval of changes that i made albeit it's just 2 added lines to grammar.js
sure it works, parses with no errors, but should it have the same precedence as a concatenation operator..?

@qm3ster
Copy link

qm3ster commented Mar 3, 2025

++ binds stronger than |>, you can check by doing
[1] |> (x: x) ++ [2] and [1] ++ (x: x) <| [2] in nix repl
(it fails because it tries to concatenate with the function, instead of applying it)

@q60
Copy link
Author

q60 commented Mar 3, 2025

seems to be working fine, i've checked parsing and highlighting a bunch of stuff. also checked on my code in helix. precedence and associativity set according to https://github.com/NixOS/nix/blob/master/doc/manual/source/language/operators.md

needs thorough testing i guess... i don't know how to test this nor to write tree-sitter tests in compliance with best practices. included test file does not work, but it would be nice to have at least something on the level of rnix-parser and nil parser tests. please excuse me as i am inexperienced in this field looking wide-eyed at all these parsers... i don't know what am i supposed to do lol

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.

2 participants