Commit graph

1036 commits

Author SHA1 Message Date
Amaan Qureshi 5d99014bb8 style: rephrase extends beyond to contains or starts after
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 15s
Check Bindgen Output / check-bindgen (push) Has been cancelled
Deploy Docs / deploy-docs (push) Has been cancelled
2024-12-28 18:53:08 -05:00
Amaan Qureshi 694d636322 fix(lib): correct fix for parsing hang with ranges containing empty points
Some checks failed
CI / checks (push) Waiting to run
Deploy Docs / deploy-docs (push) Waiting to run
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 15s
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
Some checks failed
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 14s
Check Bindgen Output / check-bindgen (push) Has been cancelled
CI / checks (push) Has been cancelled
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)
Some checks failed
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 14s
Check Bindgen Output / check-bindgen (push) Has been cancelled
CI / checks (push) Has been cancelled
2024-12-19 22:49:54 -08:00
Amaan Qureshi 7d3dbc062d build: bump deps
Some checks failed
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 14s
Check Bindgen Output / check-bindgen (push) Has been cancelled
CI / checks (push) Has been cancelled
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
Some checks failed
Check Bindgen Output / check-bindgen (push) Waiting to run
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 13s
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
Some checks failed
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 13s
Check Bindgen Output / check-bindgen (push) Has been cancelled
CI / checks (push) Has been cancelled
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
Some checks failed
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 12s
Check Bindgen Output / check-bindgen (push) Has been cancelled
CI / checks (push) Has been cancelled
2024-10-30 18:35:38 -04:00
Amaan Qureshi 55bda0a968 build: regenerate bindings.rs & add Language::name
Some checks failed
Check Bindgen Output / check-bindgen (push) Waiting to run
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 13s
2024-10-29 18:51:27 -04:00
Amaan Qureshi 350fff24bf fix(lib): simplify edge cases with zero-width tokens
Some checks failed
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 14s
CI / checks (push) Has been cancelled
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
Some checks failed
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 14s
CI / checks (push) Has been cancelled
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
Mrmaxmeier c03977a87e
fix: return LanguageRef in Parser::language
Some checks failed
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 14s
CI / checks (push) Has been cancelled
`ts_parser_language` doesn't do any refcounting, so we can't return the
resulting pointer as an owned Language object
2024-10-17 15:44:08 -04:00
ObserverOfTime ac37e60559 refactor(web): use fs/promises
Some checks failed
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 13s
CI / checks (push) Has been cancelled
2024-10-15 16:10:23 +00:00
Amaan Qureshi 38e3e51fca feat(rust): add Language::node_kind_is_supertype 2024-10-14 17:53:22 -04:00
Amaan Qureshi 68c1fb66bd fix(lib): add parameter names in declarations in subtree.h 2024-10-13 23:05:40 -04:00
ObserverOfTime b7421bf89f revert: "Memory errors in wasm_store"
This reverts commit 178c5d93f4.
2024-10-13 16:40:15 +03:00
Ryan Patterson 178c5d93f4 Memory errors in wasm_store
```
In file included from tree_sitter/core/lib/src/lib.c:14:
tree_sitter/core/lib/src/./wasm_store.c:868:94: warning: incompatible pointer types passing 'uint32_t *' (aka 'unsigned int *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
  error = wasmtime_table_grow(context, &function_table, lexer_definitions_len, &initializer, &table_index);
                                                                                             ^~~~~~~~~~~~
/Users/rpatterson/Projects/amel/py-tree-sitter/.direnv/python-3.11/include/wasmtime/table.h:105:31: note: passing argument to parameter 'prev_size' here
                    uint64_t *prev_size);
                              ^
In file included from tree_sitter/core/lib/src/lib.c:14:
tree_sitter/core/lib/src/./wasm_store.c:969:102: warning: incompatible pointer types passing 'uint32_t *' (aka 'unsigned int *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
  error = wasmtime_table_grow(context, &self->function_table, dylink_info->table_size, &initializer, &prev_table_size);
                                                                                                     ^~~~~~~~~~~~~~~~
/Users/rpatterson/Projects/amel/py-tree-sitter/.direnv/python-3.11/include/wasmtime/table.h:105:31: note: passing argument to parameter 'prev_size' here
                    uint64_t *prev_size);
                              ^
2 warnings generated.
```
2024-10-13 13:10:56 +03:00
Amaan Qureshi fe92e978f9 fix(lib): properly reset the lexer's start postiion 2024-10-11 19:02:41 -04:00
ObserverOfTime 7715001692 build: tune compiler warnings 2024-10-11 18:33:07 -04:00
Amaan Qureshi 20c2783310 fix(lib): fix compilation issue on windows with endian.h 2024-10-11 15:25:51 -04:00
Christian Clason b7a00527be build(deps): bump wasmtime to v25.0.2 2024-10-09 19:33:38 +02:00
Amaan Qureshi 538a197976 fix(lib): correct unexpected side effect in get_column when the lexer is at EOF 2024-10-08 23:27:42 -04:00
Amaan Qureshi 9c08edb066 build: configure clippy lints at the workspace level 2024-10-08 21:07:41 -04:00
Will Lillis 5c6445edea
chore: misc clippy lints 2024-10-06 17:55:00 -04:00
Antonin Delpeuch 50bea73ce3
docs(rust): updated README to reflect language initialization updates 2024-10-06 13:30:05 -04:00
dundargoc 94f7a47abd build: fix incorrect variable checks
Some checks failed
CI / sanitize (push) Failing after 11s
CI / build (push) Failing after 12s
CI / checks (push) Has been cancelled
Cmake variables should not use `${}` when checking for existence.
2024-10-06 15:56:05 +02:00
Amaan Qureshi cc2caecf7a build: tweak Cargo.tomls
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 13s
2024-10-06 01:48:43 -04:00
Amaan Qureshi 8943983df6 feat!: properly handle UTF-16 endianness encoding 2024-10-05 21:12:48 -04:00