tree-sitter-teal icon indicating copy to clipboard operation
tree-sitter-teal copied to clipboard

More fields

Open Xandaros opened this issue 3 years ago • 0 comments

As alluded to in #9, the parser could really do with more fields.

For example, the current record definition is

    _record_def: $ => seq(
      "record",
      field("name", $.identifier),
      optional($.typeargs),
      $.record_body
    ),

The name is in a field, but the typeargs and body are not. This leads to some weird gymnastics, where you need to iterate over the child notes and check their kind instead of being able to just say "get me this field".

Xandaros avatar Jul 01 '21 10:07 Xandaros