tree-sitter.tree-sitter/crates/cli/src
Will Lillis 65e8b25413
wip(generate): emit 3-way per-state parse table layout (plan B)
Replace the per-grammar CSR-vs-hybrid choice with a per-state picker
that places each state in the smallest of dense / CSR / small. State
ids are partitioned into contiguous tiers [Dense | CSR | Small] driven
by `large_state_count` and a new `csr_state_count` field on
TSLanguage. The runtime dispatches on two range checks; the rest of
the lookup logic per tier is unchanged.

States 0 (error) and 1 (start state) are pinned to the Dense tier so
they remain at indices 0 and 1, matching the runtime's hard-coded
expectations. Cost is bounded at ~2 * SYMBOL_COUNT * 2 bytes per
grammar.

Cleanup: drop --table-fmt CLI, OptLevel::ForceHybridTable /
ForceCompressedTable, RenderError::ConflictingParseTableFlags,
heuristic_should_compress, and use_compressed_tables since the free
picker provably picks the smallest representation per state.

Tests pass against the regenerated fixtures. The size savings are
measured in a follow-up corpus run.
2026-05-19 18:18:20 -04:00
..
fuzz build(rust): update deps 2026-02-18 00:59:34 -05:00
templates feat(bindings): update zig template to 0.16 2026-04-20 09:31:18 +02:00
tests perf(generate): add CSR-compressed parse tables (ABI 16) 2026-05-19 17:57:49 -04:00
fuzz.rs perf(cli): replace regex with manual parsing in test file parser 2026-03-31 04:00:43 -04:00
highlight.rs fix(rust): address new nightly lints 2026-03-28 05:23:10 -04:00
init.rs fix(rust): correct various typos 2026-03-28 05:23:10 -04:00
input.rs cli: fix clippy warnings from edition bump 2026-02-18 00:59:34 -05:00
logger.rs fix(cli): rework coloring abstraction and fix NO_COLOR handling 2026-05-17 15:02:08 -04:00
main.rs wip(generate): emit 3-way per-state parse table layout (plan B) 2026-05-19 18:18:20 -04:00
paint.rs perf(cli): stream CST rendering via Display wrappers 2026-05-17 15:02:08 -04:00
parse.rs perf(cli): stream CST rendering via Display wrappers 2026-05-17 15:02:08 -04:00
playground.html docs(playground): highlight full row for highlighted nodes 2026-01-18 23:48:58 -05:00
playground.rs cli: fix clippy warnings from edition bump 2026-02-18 00:59:34 -05:00
query.rs perf(cli): buffer stdout in parse and query output 2026-03-31 01:27:05 -04:00
query_testing.rs cli: fix clippy warnings from edition bump 2026-02-18 00:59:34 -05:00
tags.rs cli: fix clippy warnings from edition bump 2026-02-18 00:59:34 -05:00
test.rs perf(cli): stream CST rendering via Display wrappers 2026-05-17 15:02:08 -04:00
test_highlight.rs feat(highlight)!: utf16 support 2026-02-18 01:54:20 -05:00
test_tags.rs cli: fix clippy warnings from edition bump 2026-02-18 00:59:34 -05:00
tests.rs perf(generate): add CSR-compressed parse tables (ABI 16) 2026-05-19 17:57:49 -04:00
tree_sitter_cli.rs fix(cli): rework coloring abstraction and fix NO_COLOR handling 2026-05-17 15:02:08 -04:00
util.rs cli: fix clippy warnings from edition bump 2026-02-18 00:59:34 -05:00
version.rs fix: skip missing Makefile in version command 2026-02-27 10:01:59 +01:00
wasm.rs fix(rust): address new nightly lints 2026-03-28 05:23:10 -04:00