As the call to `symbol_is_used` does not depend
on the production, it is more efficient to call it
only once outside the loop over productions.
I'm not sure if `rustc` is able to do this optimization
on its own (it would need to know that the function
is pure, which sounds difficult in general).
(cherry picked from commit 36d93aeff3)
The period was dropped in the `thiserror` refactor
(79444e07f9), which caused the
`test_flatten_grammar_with_recursive_inline_variable` test to fail.
Signed-off-by: James McCoy <jamessan@jamessan.com>
(cherry picked from commit a6e530b33d)
* 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)
This fix allows for more granular address control when marshalling nodes
across WASM. This is necessary for node methods which accept another
node as a parameter (i.e., `childWithDescendant()`)
(cherry picked from commit 21390af2dd)
**Problem:** After `ts_parser_parse_with_options()`, the parser options
are still stored in the parser object, meaning that a successive call to
`ts_parser_parse()` will actually behave like
`ts_parser_parse_with_options()`, which is not obvious and can have
unintended consequences.
**Solution:** Reset to empty options state after
`ts_parser_parse_with_options()`.
(cherry picked from commit 733d7513af)
Improve the `NonTokenReservedWord` error message by including the
specific reserved word that was not used as a token.
(cherry picked from commit 92c5d3b8e2)