mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:36:22 -04:00
Track the iterator's phase so exhaustion is sticky, and gate the symbol name on it, so `NULL` means "not positioned on a symbol". `ts_lookahead_iterator_new` was also the only language consuming constructor that did not `ts_language_copy`, so an iterator outliving a wasm language read freed memory. Retain in `_new` and `_reset`, release in `_delete`. Previously: - `ts_lookahead_iterator__next` left a small parse state's cursor one past its group end, so re-advancing an exhausted iterator resumed returning `true` and walked through the rest of `ts_small_parse_table` and off the end of it. - `ts_lookahead_iterator_current_symbol_name` returned `NULL` only when the exhausted symbol index happened to fall outside the names table, so a grammar with aliases returned a real but wrong name instead. |
||
|---|---|---|
| .cargo | ||
| .github | ||
| .zed | ||
| crates | ||
| docs | ||
| lib | ||
| test/fixtures | ||
| .dockerignore | ||
| .editorconfig | ||
| .envrc | ||
| .gitattributes | ||
| .gitignore | ||
| .taplo.toml | ||
| build.zig | ||
| build.zig.zon | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CMakeLists.txt | ||
| CONTRIBUTING.md | ||
| Dockerfile | ||
| flake.lock | ||
| flake.nix | ||
| FUNDING.json | ||
| LICENSE | ||
| Makefile | ||
| Package.swift | ||
| 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