* Fix pkgconfig
Init CMAKE_INSTALL_INCLUDEDIR before pc file generation.
Install pc file to CMAKE_INSTALL_LIBDIR/pkgconfig -
it accompanies the architecture-dependent library.
* Include GNUInstallDirs early
The CMake module initializes variables which are used for
exported information (CMake and pkgconfig).
* Change pc file install destination
(cherry picked from commit 0bdf698673)
This reverts commit dc4e232e6e.
Reason: The sha in the generated output (which most distro builds of
tree-sitter, including `cargo install`, strip) produces too many
conflicts when verifying via CI that parsers are regenerated on every
grammar change.
(cherry picked from commit e7f9160867)
It is very common practice to ignore
these lock files for libraries, since they do not apply to applications
that use the libraries. The lock files are especially not useful in
tree-sitter grammar repos, since tree-sitter grammars should not have
dependencies. The lock files are just a source of merge conflicts and
spurious CI failures.
wasn't created.
This fixes an OOB access to `self.steps` when a last child anchor
immediately follows a predicate.
(cherry picked from commit b1d2b7cfb8)
Improve the `NonTokenReservedWord` error message by including the
specific reserved word that was not used as a token.
(cherry picked from commit 92c5d3b8e2)
This makes `parser.c` follow the https://generated.at/ convention for generated files. This potentially allows any compatible IDE to discourage editing it directly.
(cherry picked from commit 52d2865365)
* Rename corpus test functions to allow easy filtering by language
* Use usize for seed argument
* Avoid retaining useless stack versions when reductions merge
We found this problem when debugging an infinite loop that happened
during error recovery when using the Zig grammar. The large number of
unnecessary paused stack versions were preventing the correct recovery
strategy from being tried.
* Fix leaked lookahead token when reduction results in a merged stack
* Enable running PHP tests in CI
* Fix possible infinite loop during error recovery at EOF
* Account for external scanner state changes when detecting changed ranges in subtrees
(cherry picked from commit 066fd77d39)
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Problem: Linking different parsers into one executable fails due to duplicate symbols.
Solution: Mark `TSCharacterRange` as `static` when generating parsers.
fixes#4209
(cherry picked from commit 8138dba800)
Instead of having users declare the extern function themselves, they can
pass in the language to `Language.create` in the zig bindings. If they
really want, they can always opt into the `extern fn tree_sitter_LANG()
*const ts.Language` approach.
**Problem:** When resetting the parser during subtree balancing, an
error is thrown:
```
parser.c:2198: ts_parser_parse: Assertion `self->finished_tree.ptr' failed.
```
**Solution:** Reset `canceled_balancing` to false in
`ts_parser_reset()`.