Commit graph

32 commits

Author SHA1 Message Date
Amaan Qureshi
821cf797f2 feat(lib)!: remove deprecated functions 2025-09-12 02:50:30 -04:00
Amaan Qureshi
b7f36a13ba fix(lib): check if an ERROR node is named before assuming it's the builtin error node 2025-08-28 17:13:57 -04:00
Amaan Qureshi
8bb1448a6f feat: add the semantic version to TSLanguage, and expose an API for retrieving it 2025-01-25 01:14:30 -05:00
Riley Bruins
19482834bd feat: add Supertype API
Introduces a new function that takes in a supertype symbol and returns
all associated subtypes. Can be used by query.c to give better errors
for invalid subtypes, as well as downstream applications like the query
LSP to give better diagnostics.
2025-01-05 00:14:09 -05:00
Max Brunsfeld
201b41cf11
feat: add 'reserved word' construct
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-12-23 03:06:32 -05:00
ObserverOfTime
c5ee0ac070 feat(lib): add the language name 2024-10-26 23:53:58 +00:00
Riley Bruins
0683136ca0 feat(api): expose function to check if symbol represents a supertype 2024-09-30 14:44:13 -04:00
Amaan Qureshi
28972f916a fix(lib): silence warnings with -Wpedantic 2024-09-27 12:58:26 -04:00
Max Brunsfeld
dfc6d93bae Rename wasm C sources to avoid conflicts with standard wasm headers
Co-authored-by: Marshall <marshall@zed.dev>
2024-02-26 13:08:30 -08:00
Max Brunsfeld
4a8e4b1963 Allow wasm languages to be deleted 2023-12-27 15:00:16 -08:00
Max Brunsfeld
da16cb1459 Introduce language ref-count management C APIs, remove Copy impl for Language in Rust 2023-12-27 14:59:16 -08:00
Max Brunsfeld
e9289d3b30 Fix error when wrong language name is passed to load_language 2023-11-24 20:25:28 -08:00
Andrew Hlynskyi
26c3ae7b98 Rename: ts_lookahead_iterator_advance -> ts_lookahead_iterator_next 2023-08-09 14:40:29 +03:00
Amaan Qureshi
d710dc9c89 fix: ensure function signatures in the API consistently show parameter names 2023-08-03 22:17:53 +01:00
Daumantas Kavolis
672d38803e Add iteration over names 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
c47e217e73 API extensions 2023-08-02 00:02:33 +03:00
Amaan Qureshi
753fa1c3ff
fix(lib): explicitly cast numbers to the same size in potential spots for infinite loops 2023-07-19 03:49:14 -04:00
Max Brunsfeld
584b55df8d Delete unused code, tweak whitespace 2022-01-19 16:54:57 -08:00
Patrick Thomson
3e4cda8353 Fix check in ts_language_symbol_type (#997)
As per Max's advice, this function should only return
`TSSymbolTypeRegular` when the metadata is both visible and named.
2021-03-17 14:12:58 -04:00
Max Brunsfeld
774ae5e3d5 In parse tables, store production ids as 16 bits
Also remove the use of bitfields from the parse table format.
In all cases, bitfields were not necessary to achieve the
current binary sizes. Avoiding them makes the binaries more
portable.

There was no way to make this change backward-compatible,
so we have finally dropped support for parsers generated
with an earlier version of Tree-sitter.

At some point, when Atom adopts this version of Tree-sitter,
this change will affect Atom users who have installed packages
using third-party Tree-sitter parsers. The packages will need
to be updated to use a regenerated version of the parsers.
2021-02-25 16:12:31 -08:00
Max Brunsfeld
b5a9adb555 Allow queries to match on supertypes
Co-authored-by: Ayman Nadeem <aymannadeem@github.com>
2020-09-21 12:34:48 -07:00
Riccardo Schirone
780e9cecc9 Do not use multiple unnamed structs inside of unions 2020-04-29 20:42:45 +02:00
Tuấn-Anh Nguyễn
23261c4f6f Make ts_language_symbol_name return NULL for out-of-bound ids 2020-02-27 22:24:00 +07:00
Tuấn-Anh Nguyễn
c719e24a45 Make ts_language_field_name_for_id return NULL for out-of-bound id 2020-02-27 21:19:08 +07:00
Max Brunsfeld
56c620c005 Store a mapping to ensure no two symbols map to the same metadata 2019-12-05 17:21:46 -08:00
Max Brunsfeld
ce633a85c6 Improve ts_language_symbol_for_name function 2019-11-15 14:21:13 -08:00
Max Brunsfeld
49ce2fddb9 Add wasm binding for running tree queries in a limited range 2019-09-12 12:14:04 -07:00
Max Brunsfeld
09a2755399 Store parse states with few lookahead symbols in a more compact way 2019-08-29 15:52:23 -07:00
Max Brunsfeld
9f608435ee Fix errors in when languages have no fields 2019-02-12 17:20:12 -08:00
Max Brunsfeld
18a13b457d Get basic field API working 2019-02-08 15:16:56 -08:00
Max Brunsfeld
dd416b0955 Update include paths to not reference 'runtime' directory 2019-01-04 17:33:34 -08:00
Max Brunsfeld
47607cecf4 Reorganize repo, add rust CLI and binding code, 2019-01-04 17:31:49 -08:00