Conversation
|
@benbaarber thank you very much for your draft PR. The grammar.js file is generated through this script: https://github.com/gpuweb/gpuweb/blob/main/wgsl/tools/extract-grammar.py and that grammar uses following bnf as source of truth: https://github.com/gpuweb/gpuweb/blob/main/wgsl/syntax.bnf You can create an issue or PR if you believe changes would not change the grammar but just how it is grouped etc. (editorial). Please let me know when this PR is ready to review. cc @dneto0 |
|
This PR is done now, added more queries and updated the grammar.js. Opened a PR in gpuweb repo to push the edits i made to the syntax.bnf & extract_grammar.py to autogenerate the updated grammar.js: gpuweb/gpuweb#5461 |
|
@mehmetoguzderin nvim-treesitter requires that supported parser repos have the src/grammar.json included because they (god knows why) decided to use a feature from a future version of tree-sitter-cli (0.26) that breaks when trying to |
|
adding it for now for testing purposes. if you dont want this file pushed to this repo let me know and I will just maintain a fork to be used with nvim-treesitter |
Did some work on the highlight query so far, initially on a version where i modified the grammar.js to expose some things as named nodes. I reverted those for now since the file has a comment that says it is auto generated. I also wanted to ask how exactly this file is autogenerated, and if it could be altered to add/expose some additional nodes?
Existing nodes that would be useful to make named nodes:
New nodes that would be useful
line_comment: $ => seq('//', /.*/),Planning to add fold and indent queries as well