The parser does not treat include, include_once, require and require_once as keywords, and thus gets confused when these are used as the name of a function called on a pipe expression.
For instance, the following code:
new Foo() |> $$->include();
new Foo() |> $$->include_once();
new Foo() |> $$->require();
new Foo() |> $$->require_once();
Summary
This diff addresses the issue described in https://github.com/slackhq/tree-sitter-hack/issues/64
The parser does not treat include, include_once, require and require_once as keywords, and thus gets confused when these are used as the name of a function called on a pipe expression.
For instance, the following code:
Is incorrectly parsed as follows:
After the changes in this PR, it's parsed correctly:
Requirements
npm run test-corpus
to make sure all tests pass.