slackhq / tree-sitter-hack

Hack grammar for tree-sitter
MIT License
33 stars 15 forks source link

Add function references #49

Closed 4e554c4c closed 2 years ago

4e554c4c commented 2 years ago

Function references conflict with a few things. It seems like this is already known for the most part, since there are already rules for type specifiers and expressions (including with type specifiers and themselves). I have simply modified this conflict to include function pointers.

There is a genuine ambiguity that this introduces between function calls and calls to function references. These are semantically identical, so I'm not that worried about it, and in order to make existing tests pass I have lowered the precedence for function pointers so that they will only parse if function calls (and other expressions) do not.

Fixes #35

Requirements (place an x in each [ ])