TravonteD / tree-sitter-fennel

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

Can't use `:` as delimiter #12

Closed BerkeleyTrue closed 2 years ago

BerkeleyTrue commented 3 years ago

I'm writing some queries and I can't seem to distinguish between methods and functions with keyword args.

(foo :bar)
(foo:bar)

Is it possible to add : or a keyword node?

What I've tried

((function_call
    name: ([(identifier) @variable
            (field_expression (identifier)*)])
    (field) @method))
; captures keywords as well.

((function_call
    name: ([(identifier) @variable
            (field_expression (identifier)*)])
    ":" @punctuation.delimiter
    (field) @method))
; throws errors
TravonteD commented 3 years ago

Thanks for suggesting this, I'll have time see the implications of this come the weekend.

TravonteD commented 3 years ago

@BerkeleyTrue I've added : to the list of keywords. Test with this branch 12-colon-keyword, if things work as expected we'll get it merged in!

otommod commented 3 years ago

I believe this can now be closed