My take on Mojo grammar for tree-sitter.
- Supports all
Mojosyntax described in the nightly language reference and targets the upcoming 1.0.0 release - In general, names of the rules are used as they are described in the language reference
- Trying to optimize state count:
Pythongrammar-
src/parser.c#define STATE_COUNT 2788 #define LARGE_STATE_COUNT 185
-
- After refactoring and adding
Mojofeatures-
src/parser.c#define STATE_COUNT 3230 #define LARGE_STATE_COUNT 267
-
- neovim-treesitter repo now supports Self-Contained Queries. Added this to keep queries in sync with the grammar
- In editors like Ki syntax-node-based code navigation and editing is one of the core features. To improve the usability of this mode, additional adjustments to the grammar may be made