slackhq / tree-sitter-hack

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

[BUG] Grammar missing support for the readonly keyword #71

Open mmanela opened 5 months ago

mmanela commented 5 months ago

Describe the bug

The grammar does not properly parse the readonly keyword

Requirements

To Reproduce

Grammar does not parse the readonly keyword properly leading to errors in the parse tree.

public static readonly int $x = 0;

Which leads to a tree with an error

(property_declaration
        (visibility_modifier)
        (static_modifier) 
        type: (type_specifier
          (qualified_identifier
            (identifier)))
        (ERROR)
        (property_declarator
          name: (variable)
          value: (integer)))

Expected behavior

I expect the readonly keyword to parse properly