chore(style,grammar): remove indirection for punctuation - #236
Conversation
|
I'm cool with this change, should we ask for the opinion of the original author? |
|
I'm good with it. Is the CI broke due to the npm thing or something else? |
|
I can do a follow up doing the same with brackets and other glyphs, this PR was to test the waters. |
It's the NPM thing :\ https://github.com/nushell/tree-sitter-nu/actions/runs/19937120301/job/57165001540?pr=236#step:5:861: https://github.com/nushell/tree-sitter-nu/actions/runs/19937120301/job/57165001540?pr=236#step:5:861 EDIT: I can do the patch here before merge @fdncred |
|
@fdncred should be ready for re-review |
| const func = immediate ? token.immediate : token; | ||
| const excluded = '\\[\\]\\-{}<>="`\'@?,:.'; |
There was a problem hiding this comment.
@blindFS @fdncred Just want to call out that these kind of const declarations are a tree-sitter DSL antipattern.
These decls bypass a lot of potential optimizations by inlining where it's not needed.
EDIT: that may only apply to extras 🤔
|
Thanks |
Most tree-sitter styles do not use indirection for anonymous nodes as it impacts readability:
https://github.com/tree-sitter/tree-sitter-rust/blob/261b20226c04ef601adbdf185a800512a5f66291/grammar.js#L249-L262
This PR is a style proposal so discussion is welcome/expected