-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Highlight echo #103
Highlight echo #103
Conversation
Specifying a left associativity made the tests pass for me: diff --git a/grammar.js b/grammar.js
index f5b8e41..3d99544 100644
--- a/grammar.js
+++ b/grammar.js
@@ -21,7 +21,6 @@ module.exports = grammar({
[$.source_file],
[$._constant_value, $._case_clause_guard_unit],
[$.integer],
- [$.pipeline_echo, $.echo],
[$.echo],
],
rules: {
@@ -378,7 +377,7 @@ module.exports = grammar({
)
)
),
- pipeline_echo: (_$) => " echo",
+ pipeline_echo: (_$) => prec.left("echo"),
echo: ($) => seq("echo", $._expression),
tuple: ($) => seq("#", "(", optional(series_of($._expression, ",")), ")"),
list: ($) => |
Thank you so much to @endofunky!! Co-authored-by: @endofunky
That works, hero!! |
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.
This looks good from what I know about tree-sitter, thanks both!
Can we have tests that shows the precedence of echo
is correct? Echoing binary operators and pipelines, for example 🙏
Done! |
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.
Thank you!!
This PR adds syntax highlight for the
echo
keyword. I'm having a problem with a test failing:I can't really understand why is that, it looks unrelated to the
echo
addition. By playing around it look like that it's that$.pipeline_echo
I've added in the|>
operator that's messing things up but I know too little about tree sitter to figure this out on my own