tree-sitter.tree-sitter/lib/src
Michael Davis 9991c0f46f Add ts_query_copy for cloning queries
This allows duplicating a query so that it can be modified by using
disable_capture or disable_pattern, without re-parsing the query. The
new `ts_query_copy` creates a deep copy of the entire query object.

A motivation for this is tags.scm code navigation queries. You might
want to have one version of the compiled query capture only definitions
and the other only capture references, since references are much much
more common than definitions in a typical codebase. Instead of
re-parsing and analyzing the query and then calling
`ts_query_disable_capture`, we can clone the built query all-at-once and
then disable captures / patterns.
2026-06-27 17:53:13 -04:00
..
portable lib: add Solaris support to the portable endian header 2026-04-26 13:23:32 -04:00
unicode Expand on query docs 2019-10-30 10:26:10 -07:00
wasm fix(wasm): when reallocating the last allocated region, properly grow 2026-01-31 18:24:31 -05:00
alloc.c fix(lib): include api.h so ts_set_allocator is visible 2024-02-27 09:21:17 -05:00
alloc.h fix(lib): use correct TREE_SITTER_HIDE_SYMBOLS macro name in alloc.h 2026-05-30 21:42:31 -04:00
array.h lib: clean up strict aliasing fixes in array.h 2026-02-08 11:09:31 +01:00
atomic.h Merge branch 'master' into wasm-language 2023-10-27 12:11:43 +01:00
error_costs.h Just call the C lib 'the library' everywhere, don't call it a 'runtime' 2019-01-10 15:22:39 -08:00
get_changed_ranges.c feat: add API for editing points and ranges 2025-09-19 17:40:26 -04:00
get_changed_ranges.h Just call the C lib 'the library' everywhere, don't call it a 'runtime' 2019-01-10 15:22:39 -08:00
host.h Make SubtreeInlineData work on Big-Endian 2021-12-24 16:47:10 +01:00
language.c feat(lib)!: remove deprecated functions 2025-09-12 02:50:30 -04:00
language.h fix(lib): correct various typos 2026-03-28 05:23:10 -04:00
length.h fix(lib): add saturating subtraction to prevent integer underflow 2024-12-25 04:49:39 -05:00
lexer.c feat(c): rename DecodeFunction to TSDecodeFunction 2025-09-01 03:17:44 -04:00
lexer.h chore: cleanup unused code 2025-01-21 01:17:03 -05:00
lib.c feat: add API for editing points and ranges 2025-09-19 17:40:26 -04:00
node.c feat: add API for editing points and ranges 2025-09-19 17:40:26 -04:00
parser.c fix(lib): Consider subtree lookahead bytes when determining whether the 2026-06-01 18:12:56 -04:00
parser.h fix(lib): remove duplicate TSLanguageMetadata typedef (#4268) 2025-03-06 14:14:25 -08:00
point.c feat: add API for editing points and ranges 2025-09-19 17:40:26 -04:00
point.h chore: cleanup unused code 2025-01-21 01:17:03 -05:00
query.c Add ts_query_copy for cloning queries 2026-06-27 17:53:13 -04:00
reduce_action.h Generate node-fields.json file 2019-02-12 11:06:18 -08:00
reusable_node.h Allocate parent nodes together with their child array 2020-10-23 12:15:44 -07:00
stack.c fix(lib): replace raw array accesses with array_get 2025-06-05 00:53:11 -04:00
stack.h Fix cases where error recovery could infinite loop (#4257) 2025-03-04 13:50:56 -08:00
subtree.c fix(lib): rewrite ts_subtree__write_to_string to be iterative 2026-05-31 10:56:12 -04:00
subtree.h fix(lib): cast NULL in ts_subtree_children macro 2026-02-21 01:37:03 -05:00
tree.c feat: add API for editing points and ranges 2025-09-19 17:40:26 -04:00
tree.h style(lib): add parameter names in declarations that are missing them 2024-09-27 13:38:08 -04:00
tree_cursor.c fix(lib): address strict aliasing violations in TreeCursor type 2026-06-16 23:55:43 -04:00
tree_cursor.h style(lib): add parameter names in declarations that are missing them 2024-09-27 13:38:08 -04:00
ts_assert.h fix(lib): silence warnings with -Wpedantic 2024-09-27 12:58:26 -04:00
unicode.h lexer: pass code-unit length to U16_NEXT in UTF-16 decoders 2026-04-26 03:38:47 -04:00
wasm_store.c fix(wasm): load supertype tables for ABI 15 grammars (#5605) 2026-05-18 16:33:55 -04:00
wasm_store.h style(lib): add parameter names in declarations that are missing them 2024-09-27 13:38:08 -04:00