tree-sitter/lib
Patrick Thomson 6e2a60629c Make ts_tree_delete and ts_parser_delete NULL-safe.
Historically, `free(3)`-style functions have been NULL-safe, to make
resource handling functions more robust. This doesn't seem to be the
case with tree-sitter's `ts_tree_delete` and `ts_parser_delete` C
functions, which immediately dereference the passed pointer. This
leads to complexity in client libraries that have to ensure that trees
and parsers are cleaned up correctly.

This patch adds NULL checks to `parse_delete` and `tree_delete`. They
should have negligable performance impacts, since null checks are fast.

I didn't change the internal _delete functions, as arguably those
being NULL-unsafe is a feature, not a bug.
2019-05-30 11:47:56 -04:00
..
binding_rust Add support for highlight properties that track local variables 2019-05-09 20:34:34 -07:00
binding_web Merge pull request #342 from georgewfraser/patch-1 2019-05-28 15:31:23 -07:00
include/tree_sitter Fix accidentally-removed functions in api.h 2019-03-29 23:05:02 -07:00
src Make ts_tree_delete and ts_parser_delete NULL-safe. 2019-05-30 11:47:56 -04:00
utf8proc@d81308faba Reorganize repo, add rust CLI and binding code, 2019-01-04 17:31:49 -08:00
Cargo.toml Reorganize language bindings 2019-05-07 10:41:49 -07:00
README.md Set up code to publish web bindings to npm 2019-05-07 13:11:04 -07:00

Subdirectories

  • src - C source code for the Tree-sitter library
  • include - C headers for the Tree-sitter library
  • utf8proc - A submodule for utf8proc, Tree-sitter's one library dependency.
  • binding_rust - Rust bindings to the Tree-sitter library
  • binding_web - JavaScript bindings to the Tree-sitter library, using WebAssembly