/tree-sitter-re2c

re2c grammar for tree-sitter

Primary LanguageJavaScriptMIT LicenseMIT

Tree-sitter for re2c

The tree-sitter-re2c is a re2c parser for tree-sitter.

Injection

The host languague shall be injected in the host_lang rule of this grammar.

Example of how this can be done with nvim-tree-sitter:

On the re2c/queries/injections.scm:

 (re2c
 . (host_lang) @_c
   (#match? @_c "^[ \t]*#include")) @c

 (re2c
 . (host_lang) @_c
   (#match? @_c "^[ \t]*#package main")) @go

References