wenkokke / tree-sitter-talon

Tree Sitter parser for Talon files.
MIT License
8 stars 5 forks source link

add support for a couple new declaration types #20

Closed pokey closed 1 year ago

pokey commented 1 year ago
wenkokke commented 1 year ago

I've added the patterns for these bindings to the syntax, but I've not pushed them through yet.

(See line 154 onwards in grammar.js.)

wenkokke commented 1 year ago

I couldn't decide whether to abstract over these patterns or not, but abstracting over them would cause changes in the parsed AST.

pokey commented 1 year ago

I'd be inclined to just do the simple thing for now and not abstract over them. Can always revisit

wenkokke commented 1 year ago

If you're so inclined, this really just requires wiring up the binding nonterminals that are already there to some new declaration types following:

key_binding_declaration: ($) =>
      seq(
        field("left", $._key_binding),
        ":",
        field("right", $._statements),
      ),

And adding some tests.

wenkokke commented 1 year ago

These should work from 3.4.0 onwards. Please report bugs if you find them.