A slop fork of Tree-sitter to fix some inefficiencies.
  • Rust 64.2%
  • C 24.4%
  • TypeScript 6.3%
  • C++ 1.3%
  • JavaScript 1%
  • Other 2.6%
Find a file
Nils Söderwall f20fa674c1 feat(generate): account allocations behind TS_MEM_STATS
Reshaping the table builder for memory needs a way to tell where the
memory goes, and a profiler attributes allocation sites rather than
phases: it says which call allocated, not which phase still holds the
result. What matters here is what a phase *retains*.

The CLI installs a tracking global allocator that keeps a running total
of live bytes and their high-water mark, and the generator reports the
totals at each phase boundary. Sizes for individual structures come from
dropping or clearing them and differencing the live total, which is
exact, rather than from estimating a layout.

Everything stays quiet unless TS_MEM_STATS is set, so an instrumented
binary behaves like an uninstrumented one; accounting itself is two
relaxed atomics per allocation and does not measurably change generation
time. TS_MEM_SIZES additionally sizes structures by cloning them, which
inflates the very peak the phase report exists to measure and is
therefore separate. TS_MEM_DISSECT takes the finished table apart to
attribute it field by field, and necessarily ends the run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 22:48:16 +00:00
.cargo chore: remove CARGO_WORKSPACE_DIR var 2025-09-24 16:14:08 -04:00
.github fix(lib): address strict aliasing violations in TreeCursor type 2026-06-17 00:29:06 -04:00
.zed Add zed config file (enable all cargo features for rust-analyzer) 2025-04-23 16:32:21 -07:00
crates feat(generate): account allocations behind TS_MEM_STATS 2026-07-26 22:48:16 +00:00
docs docs: note zero point unbounded behavior in query functions 2026-04-30 19:19:03 -04:00
lib feat(generate): emit large lex tables as chunk functions 2026-07-26 22:48:16 +00:00
test/fixtures fix(lib): Consider subtree lookahead bytes when determining whether the 2026-06-01 19:12:50 -04:00
.dockerignore Add a simple dockerfile for testing 2024-03-18 12:35:10 -07:00
.editorconfig style(zig): reformat files 2025-08-28 20:54:25 +03:00
.envrc feat: add nix flake 2025-09-01 22:48:37 -04:00
.gitattributes Reorganize rust crates into a flat crates directory, simplify some CI steps (#4496) 2025-06-06 14:25:37 -07:00
.gitignore refactor: rework nix flake 2025-09-09 03:03:35 -04:00
build.zig fix(build): define _BSD_SOURCE 2026-01-12 23:43:46 -05:00
build.zig.zon release v0.26.10 2026-06-28 11:47:27 -04:00
Cargo.lock perf(generate): shrink the parse table build 2026-07-26 22:48:16 +00:00
Cargo.toml perf(generate): shrink the parse table build 2026-07-26 22:48:16 +00:00
CMakeLists.txt release v0.26.10 2026-06-28 11:47:27 -04:00
CONTRIBUTING.md docs: improve docs for contributing to docs 2025-01-10 22:57:54 -05:00
Dockerfile Add a simple dockerfile for testing 2024-03-18 12:35:10 -07:00
flake.lock refactor: rework nix flake 2025-09-09 03:03:35 -04:00
flake.nix release v0.26.10 2026-06-28 11:47:27 -04:00
FUNDING.json chore: add FUNDING.json 2023-11-08 00:08:07 -05:00
LICENSE chore: copy license to all packages 2025-09-11 03:12:35 -04:00
Makefile release v0.26.10 2026-06-28 11:47:27 -04:00
Package.swift fix(build): define _BSD_SOURCE 2026-01-12 23:43:46 -05:00
README.md docs: change WASM/wasm to Wasm 2025-08-21 09:56:32 +03:00

tree-sitter

DOI discord matrix

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