slackhq / tree-sitter-hack

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

[BUG] Expression tree syntax is not parsed correctly #57 #59

Closed andryak closed 6 months ago

andryak commented 1 year ago

Describe the bug

The parser does not recognise expression tree syntax.

The following is valid Hack:

$x = SomeVisitorClass`some expression`;

Yet, the parser does not parse it correctly:

(script
      (expression_statement
        (binary_expression
          (variable)
          (qualified_identifier
            (identifier)))
        (ERROR
          (UNEXPECTED '`')
          (identifier)
          (identifier)
          (UNEXPECTED '`'))))

Requirements

To Reproduce

Add a new test with content $x = SomeVisitorClass`some expression`;, then run tree-sitter test.

Expected behavior

No errors are reported in the syntax tree.