An incremental parsing system for programming tools
https://tree-sitter.github.io
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. |
||
|---|---|---|
| cli | ||
| docs | ||
| highlight | ||
| lib | ||
| script | ||
| test | ||
| .appveyor.yml | ||
| .gitignore | ||
| .gitmodules | ||
| .travis.yml | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
tree-sitter
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