An incremental parsing system for programming tools https://tree-sitter.github.io
Find a file
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
cli Fix presentation of missing nodes in parse command 2019-05-15 16:25:53 -07:00
docs Reorder objects in documentation for consistency 2019-05-21 07:52:23 -04:00
highlight Add missing enumerator in C header for highlighting 2019-05-10 14:38:19 -07:00
lib Make ts_tree_delete and ts_parser_delete NULL-safe. 2019-05-30 11:47:56 -04:00
script Discard local emsdk changes when fetching emscripten on CI 2019-05-22 10:41:19 -07:00
test Fix handling of zero-width external tokens at beginning of document 2019-04-08 15:01:52 -07:00
.appveyor.yml Build and test wasm on CI 2019-04-26 14:38:13 -07:00
.gitignore Build and test wasm on CI 2019-04-26 14:38:13 -07:00
.gitmodules Reorganize repo, add rust CLI and binding code, 2019-01-04 17:31:49 -08:00
.travis.yml Don't include wasm library in the CLI binary on windows 2019-05-14 15:51:12 -07:00
Cargo.lock Start work on web UI command 2019-05-13 21:51:17 -07:00
Cargo.toml Move code into cli directory 2019-01-04 16:50:52 -08:00
LICENSE Add boilerplate 2018-05-17 14:46:29 -07:00
README.md Use https README docs site link 2019-04-30 13:00:27 -07:00

tree-sitter

Build Status Build status

Tree-sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited. Tree-sitter aims to be:

  • General enough to parse any programming language
  • Fast enough to parse on every keystroke in a text editor
  • Robust enough to provide useful results even in the presence of syntax errors
  • Dependency-free so that the runtime library (which is written in pure C) can be embedded in any application

Documentation