Cooklang Tree-Sitter Grammar

December 27, 2021 ยท View on GitHub

This is a Tree-Sitter grammar for Cooklang.

TODO

  • Syntax highlighting
  • Properly handle unreserved_symbols.

Notable Differences

  • It appears that the Cooklang BNF doesn't actually allow for punctuation (eg. -) in words (like ingredient names), but the compiler allows for it. I explicitly put it in this grammar since it seems useful. This is hacky.
  • Newline and whitespace characters are handled slightly differently due to the way Tree-Sitter views them.

References