Commit graph

701 commits

Author SHA1 Message Date
Andrew Hlynskyi
d489d71623 fix: children_by_field_id API to receive non option field id 2023-08-01 12:21:24 +03:00
Andrew Hlynskyi
fec7454ced chore: simply use FieldId::new because it contains id == 0 check 2023-08-01 11:45:54 +03:00
Andrew Hlynskyi
9c06b90fc2 More general TextProvider for F 2023-07-31 04:13:18 +03:00
Andrew Hlynskyi
7938db90fe TextProvider with generic return type 2023-07-30 21:56:58 +03:00
Amaan Qureshi
36c6c8aadf
Merge pull request #2423 from amaanq/nonzero-field-id
feat!: use `Option<NonZeroU16>` for TSFieldIds
2023-07-27 13:04:34 -04:00
Amaan Qureshi
7ad21396c2
feat!: use Option<NonZeroU16> for TSFieldIds 2023-07-27 12:26:25 -04:00
Amaan Qureshi
7d4b0110a9
Merge pull request #2429 from the-mikedavis/md-prev-child-fix
ts_node__prev_child: Reset earlier node when backtracking
2023-07-25 16:22:36 -04:00
Amaan Qureshi
9fbc34fd3e
Merge pull request #2425 from amaanq/abort
fix!: use `abort` instead of `exit(1)` when allocations fail
2023-07-24 16:56:48 -04:00
Michael Davis
5a8a4b0dcf
ts_node__prev_child: Reset earlier node when backtracking
`earlier_node` must be reset when backtracking up the tree or else
`ts_node__prev_child` may loop infinitely on a subtree which contains
zero-width tokens.
2023-07-24 15:08:55 -05:00
Amaan Qureshi
62e1d9902b
Merge pull request #2424 from amaanq/rust-docs
docs: update Rust bindings' README
2023-07-24 03:33:45 -04:00
Amaan Qureshi
269a9a8ecf
fix!: use abort instead of exit(1) when allocations fail 2023-07-24 02:28:09 -04:00
Amaan Qureshi
a4f939520f
docs: update Rust bindings' README 2023-07-24 02:07:09 -04:00
Amaan Qureshi
56870fdda2
chore: remove unneeded include 2023-07-24 00:44:45 -04:00
Amaan Qureshi
13f6ec2b0c
fix: rename shadowed variables from -Wshadow warnings and apply some useful clang-tidy warnings 2023-07-19 18:12:26 -04:00
Amaan Qureshi
9e99789e4c
Merge pull request #2407 from amaanq/bump-deps
Bump deps
2023-07-19 17:05:10 -04:00
Amaan Qureshi
8f73fb502f
Merge pull request #2408 from amaanq/codeql-bugs
fix(lib): explicitly cast numbers to the same size in potential spots for infinite loops
2023-07-19 16:11:43 -04: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
Samuel Moelius
a07cdb59f3
Handle edge cases involving consecutive "zero or" modifiers 2023-07-19 03:27:43 -04:00
Amaan Qureshi
56cedba4bf
chore: bump dependencies 2023-07-19 03:18:17 -04:00
Max Brunsfeld
40f7b2ec97 Fix parsing of queries that start with repetitions followed by alternatives 2023-07-18 17:57:52 -07:00
Amaan Qureshi
c16a8c71ce
fix: pass a value_id the same size of predicate_capture_ids's elements to avoid big-endian integer narrowing
This solves a bug on big-endian architectures where the value would be later passed by reference as an elements "view" before being inserted. The issue is it is casted as a void pointer, and when writing uint16_t's of size 1, only 2 of the 4 bytes are written. This is okay for little-endian systems, but not big-endian
2023-07-18 05:40:38 -04:00
Andrew Hlynskyi
7afd5a1a8b rust: remove Copy, Clone from opaque ptr data structs 2023-07-14 00:19:23 +03:00
Andrew Hlynskyi
af42cfccd6 rust: fix ffi impl, some structs are stack allocated 2023-07-13 23:48:38 +03:00
Amaan Qureshi
2f2e416031 chore: update Rust bindings 2023-07-13 11:39:33 -04:00
Jille Timmermans
9a74f5cbf5 Add ts_node_language() that returns the language of the node
Since an input might have a nested sublanguage (like Javascript inside
Vue) and symbols are per-language, we need to know which language a node
is.
2023-07-13 11:21:18 -04:00
Andrew Hlynskyi
f01c4f8376 Restore Rust bindings generation with newer bindgen 0.65.1 2023-07-13 17:34:32 +03:00
Max Brunsfeld
356f68293a Fix false positive query match bug, introduced in #2085 2023-07-10 16:12:59 -04:00
Amaan Qureshi
1982e48568 chore: update exports to include some string.h functions 2023-07-10 15:21:39 -04:00
Max Brunsfeld
d0029a1527 Avoid unused value warning from array_pop 2023-06-14 11:31:43 -07:00
Max Brunsfeld
4922602369
Merge pull request #2316 from tree-sitter/node-descendant-index
Add APIs for retrieving descendant counts, seeking to nodes by their descendant index
2023-06-12 15:13:43 -07:00
Max Brunsfeld
3375527a89 Fix bug in ts_tree_cursor_goto_descendant 2023-06-12 14:45:30 -07:00
Max Brunsfeld
a2119cb691 Add APIs for retrieving tree cursor's depth and descendant index 2023-06-12 11:50:44 -07:00
Max Brunsfeld
9dd725b4e3 Start work on exposing APIs for node descendant counts and indices 2023-06-09 08:51:47 -07:00
Samuel Moelius
f461d953a6 Fix OOB in Query::new 2023-05-19 21:31:26 -04:00
Philipp Mildenberger
55a8db10cc fix: bug with first child group anchor (anchor had no effect) 2023-05-13 19:40:49 +03:00
Andrew Hlynskyi
63d9f7146f Fix get_column() segfault on EOF, don't do lookahead without EOF check first 2023-04-22 12:11:26 +03:00
Andrew Hlynskyi
4f4b86a40b lib: make query step init depend from MAX_STEP_CAPTURE_COUNT decl 2023-04-19 09:37:46 +03:00
Andrew Hlynskyi
cc6596be82 chore(bindgen): update bindgen to 0.65.1 and regenerate bindings 2023-04-17 11:24:05 +03:00
Andrew Hlynskyi
d4d5e29c91 feat(lib): ts_query_cursor_set_max_start_depth - use 0 to reset 2023-04-17 11:16:04 +03:00
Lewis Russell
1e81a1b67f feat(lib): add ts_query_cursor_set_max_start_depth query API
This allows configuring cursors from traversing too deep into a tree.
2023-04-17 11:15:13 +03:00
Andrew Hlynskyi
613382c70a docs: update badges; fix markdown lint complains
Linter config `.vscode/settings.json`:
```json
{
    "[markdown]": {
        "files.trimTrailingWhitespace": false,
    },
    "markdownlint.config": {
        "default": true,
        // "ul-style": {
        //     "style": "asterisk"
        // },
        "MD001": false,
        "MD024": false,
        "MD025": false,
        "MD033": false,
        "MD041": false,
        "MD053": false,
    },
}
```
2023-04-16 23:39:08 +03:00
Andrew Hlynskyi
90fca305bf Merge branch 'recover-web-v0.20.8' into master 2023-04-10 20:32:59 +03:00
Andrew Hlynskyi
de906378ab web: 0.20.8 2023-04-10 19:50:32 +03:00
Andrew Hlynskyi
1f051d339c chore(docs): fix misprint repetitions and remove dangling spaces 2023-04-09 20:40:18 +03:00
Andrew Hlynskyi
4c2a36302b lib: fix OOB in query engine reported in #2162 2023-04-06 03:59:55 +03:00
Andrew Hlynskyi
c38f78345e binding(rust): update script/generate-bindings to use latest rust-bindgen 0.64.0 version 2023-04-04 22:16:27 +03:00
Matt
65c16bfb17 query casts 2023-04-04 17:43:27 +03:00
Matt
cde45268b6 subtree casts 2023-04-04 17:43:27 +03:00
Andrew Hlynskyi
0261a13984 lib: fix ts_node_field_name_for_child implementation
With hidden subtrees correct incorporation and field inheritance support.
2023-04-04 16:54:32 +03:00
Andrew Hlynskyi
d56506b727 ref(rust_bindings): keep Query construction logic in a one place 2023-04-04 15:08:53 +03:00