Amaan Qureshi
5de314833f
feat(query): structurally verify supertype queries
2025-01-12 13:04:10 -05:00
Amaan Qureshi
26d4b19006
build(rust): bump the lib's MSRV to 1.76
2025-01-12 04:47:59 -05:00
WillLillis
cd6e766365
fix(wasm): allow passing in ERROR in descendantsOfType
2025-01-11 03:00:20 -05:00
Amaan Qureshi
95fd37ecf8
docs: add information about the scoping of cursors
2025-01-11 02:33:48 -05:00
Amaan Qureshi
7953aba070
fix(lib): use inclusive range check for non-empty nodes in next sibling computation
2025-01-10 22:00:33 -05:00
Amaan Qureshi
0195bbf1b4
fix(lib): avoid OOB access when updating alternative steps
2025-01-10 19:41:43 -05:00
Amaan Qureshi
2814c00faa
fix(web): correct getExtent
...
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-06 01:55:15 -05:00
Amaan Qureshi
45fa028201
feat(web): add missing API functions
...
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-06 01:55:15 -05:00
Lucas Marçal
aea3a4720a
fix(endian): support POSIX mode on Apple platforms
2025-01-06 01:13:04 -05:00
Lucas Marçal
28d5272e71
build(swift): include all source files
2025-01-06 01:13:04 -05:00
WillLillis
767b5486c6
docs: clarify data returned by QueryCaptures during iteration
2025-01-05 03:01:36 -05:00
Amaan Qureshi
ef39298342
feat(wasm): add Supertype API
2025-01-05 00:14:09 -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
Amaan Qureshi
efc51a596c
fix(lib): don't consider unfinished captures definite when the following step is immediate
...
When collecting captures, we were treating unfinished ones as definite
even if they had pending immediate steps that weren't yet satisfied. Now
we only mark a capture as definite if the pattern is guaranteed and
there are no pending immediate steps to check.
2025-01-04 02:03:41 -05:00
Amaan Qureshi
5f379da544
fix(lib): prevent wildcards from incorrectly marking child patterns as infallible
...
When a pattern appears under a wildcard parent (like "(_ (expr))"), we
were incorrectly marking it as infallible. The parent_pattern_guaranteed
flag only means the pattern will match after finding the right wildcard
parent, not that any wildcard parent will work.
2025-01-03 23:09:49 -05:00
Amaan Qureshi
a7e6d01144
fix(lib): propagate last_child status to pattern alternatives in queries
...
Previously, when a pattern was marked as the last child in a query, its
alternatives weren't marked similarly, causing incorrect matching
behavior. Now, the `last_child` status is properly propagated through
all alternatives.
2025-01-03 21:13:29 -05:00
Amaan Qureshi
22f67e2b67
fix(query): ensure immediate matches for any node when an anchor follows a wildcard node
2024-12-29 00:54:16 -05:00
Amaan Qureshi
5d99014bb8
style: rephrase extends beyond to contains or starts after
2024-12-28 18:53:08 -05:00
Amaan Qureshi
694d636322
fix(lib): correct fix for parsing hang with ranges containing empty points
...
It's more correct to check the bytes of the `size` length, rather than
use the point as a condition for resetting the lexer's token start
position
2024-12-25 04:49:39 -05:00
Amaan Qureshi
f3d50f273b
fix(lib): add saturating subtraction to prevent integer underflow
2024-12-25 04:49:39 -05:00
WillLillis
7ba0f297e5
fix: re-export StreamingIterator and StreamingIteratorMut
2024-12-24 23:19:33 -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
Will Lillis
2a63077cac
style: correct typos
2024-12-23 02:11:09 -05:00
Amaan Qureshi
8744a4e3f2
feat(lib): use const for TSCharacterRanges
2024-12-23 01:19:10 -05:00
Wilfred Hughes
90666c951d
Fix typo in doc comment ( #4022 )
2024-12-19 22:49:54 -08:00
Amaan Qureshi
7d3dbc062d
build: bump deps
2024-12-16 01:22:58 -05:00
Felix Roos
6c4a50a9c7
docs(web): add instructions for Vite
2024-12-16 00:09:42 -05:00
StratusFearMe21
c053b63be8
docs(rust): update doc comment on node ids
2024-12-15 22:52:46 -05:00
Riley Bruins
495fe2a6c5
feat: support querying missing nodes
...
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-12-14 14:57:36 -05:00
Amaan Qureshi
69d977d736
fix(lib): use clock_gettime on macOS again
2024-12-03 18:12:32 -05:00
Riley Bruins
fa6c1471ef
fix(lib): correct escape detection for invalid anonymous nodes
...
The current quotation escape checker fails in the case that
there is an anonymous node that is just an escaped backslash (it thinks
the backslash escapes the quote, when really it is just an escaped
backslash itself. See the added test case for an example of this).
This commit ensures the node identification logic keeps track of the
number of backslashes seen so it can accurately determine if the
quotation is escaped or not.
2024-11-15 23:49:06 -05:00
Will Lillis
5d1be545c4
fix(lib): correct next sibling of zero width node
2024-11-12 18:17:45 -05:00
Amaan Qureshi
49ff53cc83
fix(lib): correctly fetch the node name in query errors
2024-11-10 03:44:54 +01:00
ObserverOfTime
23b03d9f4a
build(deps): bump wasmtime-c-api to v26.0.1
2024-11-09 21:04:52 +01:00
WillLillis
8c802da174
fix(lib): check point, byte ranges in node_descendant_for
...
functions
2024-11-02 03:06:07 -04:00
WillLillis
5b5cf5a5e5
fix(lib): check point, byte ranges in ts_query_cursor_set
...
range functions
2024-11-02 03:06:07 -04:00
Amaan Qureshi
e892862c6c
fix(rust): fix progress callback scope to prevent premature drop
2024-11-02 00:57:50 -04:00
Amaan Qureshi
500f4326d5
feat: add the ability to specify a custom decode function
2024-10-31 22:51:40 -04:00
Amaan Qureshi
6fdba6bbd6
feat(rust): add *_with_options to the parser and query cursor, deprecate old functions
...
The normal `with` functions are now deprecated in favor of the
`with_options` ones.
2024-10-31 21:58:35 -04:00
Amaan Qureshi
8d68980aa8
feat(lib): add ts_query_cursor_exec_with_options
...
Currently, this allows users to pass in a callback that should be
invoked to check whether or not to halt query execution
2024-10-31 21:58:35 -04:00
Amaan Qureshi
26b89da9bb
feat(lib): add ts_parser_parse_with_options
...
Currently, this allows users to pass in a callback that should be
invoked to check whether or not to halt parsing
2024-10-31 21:58:35 -04:00
Amaan Qureshi
aaba7cd2f9
feat: implement a cache for get_column
2024-10-30 18:35:38 -04:00
Amaan Qureshi
55bda0a968
build: regenerate bindings.rs & add Language::name
2024-10-29 18:51:27 -04:00
Amaan Qureshi
350fff24bf
fix(lib): simplify edge cases with zero-width tokens
2024-10-28 13:57:29 +00:00
ObserverOfTime
c5ee0ac070
feat(lib): add the language name
2024-10-26 23:53:58 +00:00
Amaan Qureshi
ce93d8fd9b
feat!: bump internal abi to 15
2024-10-26 17:02:00 +00:00
Christian Clason
66cd81a4f8
build(deps): bump wasmtime to v26.0.0
...
https://github.com/bytecodealliance/wasmtime/releases/tag/v26.0.0
reland https://github.com/tree-sitter/tree-sitter/pull/3779
2024-10-24 17:09:06 +00:00
ObserverOfTime
8515986b73
docs(rust): document optional features
2024-10-24 17:08:55 +00:00
ObserverOfTime
881c54e462
fix(lib): handle compiler warnings
2024-10-19 02:57:08 +00:00
ObserverOfTime
70c0cba15b
build: treat incompatible pointer warning as error
2024-10-19 02:57:08 +00:00