miniblog.
← Back to all posts
Wilfred Hughes
Apr 18, 2022 at 00:19
tree-sitter is adding a notion of reserved keywords, as it previously treated keywords as contextual:
https://github.com/tree-sitter/tree-sitter/pull/1635
Includes a fun example of using `if` as a name in JS!
Add 'reserved word' construct: improve error recovery by avoiding treating reserved words as other tokens by maxbrunsfeld · Pull Request #1635 · tree-sitter/tree-sitter
This is a second attempt to solve a problem described in #246. I'll copy some of the description here. Background Tree-sitter uses context-aware tokenization - in a given parse state, Tree-sitt...