slackhq / tree-sitter-hack

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

Add support for module level attributes (#58) #63

Closed andryak closed 1 year ago

andryak commented 1 year ago

Summary

This is valid Hack code that declares a module-level attribute:

<?hh

<<file: SomeClass(SomeOtherClass::class)>>

Yet, the parser does not recognize the syntax:

(script
      (ERROR
        (attribute_modifier
          (ERROR
            (identifier))
          (qualified_identifier
            (identifier))
          (arguments
            (argument
              (scoped_identifier
                (qualified_identifier
                  (identifier))
                (identifier)))))))

This PR adds support for this syntax.

Requirements

salesforce-cla[bot] commented 1 year ago

Thanks for the contribution! Unfortunately we can't verify the commit author(s): Andrea Aquino a***@f***.com. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, sign the Salesforce Inc. Contributor License Agreement and this Pull Request will be revalidated.

salesforce-cla[bot] commented 1 year ago

Thanks for the contribution! Before we can merge this, we need @andryak to sign the Salesforce Inc. Contributor License Agreement.