euclidianAce / tree-sitter-teal

A tree sitter grammar for Teal, a typed dialect of Lua
38 stars 4 forks source link

More fields #11

Closed Xandaros closed 1 year ago

Xandaros commented 3 years ago

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".