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!
Related Posts
I'm still tinkering with the website for my PL experiment. I want the styling to express "labour of love hobby project".
Choosing what program to show on the home page is really hard too. All the keywords are links like Racket.
What do you think? https://www.garden-lang.org/
Further tinkering with diagnostics, following feedback!
* Two lines of context above and below now.
* The caret is included in the line below where possible.
* Syntax highlighting of keywords.
I kinda feel that smart context sizing would be better. What do you think so far?
I'm having fun writing a simple type checker, but I'm learning firsthand why syntax-directed checking doesn't work. It prevents inference.
My checker catches real bugs, but it can't handle cases like this:
[1, 2].map(fun(x) { x + 1; })
I think I need bidirectional checking.