TravonteD / tree-sitter-fennel

Treesitter grammar for the Fennel programming language
MIT License
42 stars 9 forks source link

feat: improve table parsing #43

Closed raw1z closed 9 months ago

raw1z commented 1 year ago

Show each pair and add fields to mark keys and values. For example the following fennel code:

{: value
 "key" value
 "number" 531
 "f" (fn [x] (+ x 2))}

will be parsed as:

  (table
    (table_pair
      (binding
        (symbol)))
    (table_pair
      key: (string)
      value: (symbol))
    (table_pair
      key: (string) 
      value: (number))
    (table_pair
      key: (string)
      value: (fn
               (parameters
                 (binding
                   (symbol)))
               (list
                 (symbol)
                 (symbol)
                 (number)))))
TravonteD commented 9 months ago

@raw1z Thanks for the contribution!