slackhq / tree-sitter-hack

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

[BUG] Unable to parse enum class labels #50

Closed 4e554c4c closed 2 years ago

4e554c4c commented 2 years ago

Describe the bug

Enum class labels which use the hash (#) character are not correctly parsed by tree-sitter-hack.

This means that # should also no longer parse comments

Requirements (place an x in each of the [ ])**

Expected behavior

The following should parse as valid hack

E#B;

instead it parses as an unterminated statement:

(script [0, 0] - [1, 0]
  (ERROR [0, 0] - [0, 1]
    (identifier [0, 0] - [0, 1]))
  (comment [0, 1] - [0, 4]))