tree-sitter-todolang 0.0.1

Todolang grammar for tree-sitter
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module.exports = grammar({
  name: "todolang",

  rules: {
    source_file: ($) => repeat($._definition),
    _definition: ($) =>
      choice(
        $.todo_definition
        // TODO: more kinds of definitions
      ),
    todo_definition: ($) => choice(seq("todo", $.chars), seq("todo", $.block)),
    block: ($) => seq("{", $.chars, "}"),
    chars: (_) => repeat1(/\S/),
  },
});