Commit graph

4386 commits

Author SHA1 Message Date
Andrew Hlynskyi
0f533b909d chore: group Sync, Send impls by type 2023-08-03 03:03:03 +03:00
Andrew Hlynskyi
4f28ce4e3b Add async context tests for Node and TreeCursor 2023-08-03 03:03:03 +03:00
Andrew Hlynskyi
73bb2c36fc
Merge pull request #2461 from tree-sitter/no-ord-on-range
Remove `PartialOrd, Ord` deriving from `Range` in Rust lib
2023-08-02 19:35:29 +03:00
Andrew Hlynskyi
b456f831d1 Remove PartialOrd, Ord deriving from Range in Rust lib 2023-08-02 18:30:32 +03:00
Amaan Qureshi
0c5a6eb525
Merge pull request #2458 from the-mikedavis/md-cancellation-highlight
feat(cli): Re-use highlight cancellation flag for HTML highlights
2023-08-02 10:38:56 -04:00
Michael Davis
3e499d675a
CLI: Re-use highlight cancellation flag for HTML highlights
The `html` highlight function created its own cancellation flag which
conflicts with the Ctrl-c handler set up in the CLI's `main` block
for `tree-sitter highlight`. We can re-use the cancellation flag from
that block to avoid a panic that happens when using `tree-sitter
highlight -H <file>`

    thread 'main' panicked at 'Error setting Ctrl-C handler: MultipleHandlers', cli/src/util.rs:31:6

This change also aligns the parameters that `highlight::ansi` and
`highlight::html` take.
2023-08-02 08:56:26 -05:00
Amaan Qureshi
ca16a2b86e
Merge pull request #2445 from amaanq/eof-loop-token-rep
fix: do not allow eof to advance states if the new state is the same state
2023-08-02 07:49:18 -04:00
Amaan Qureshi
acef7a3cdf chore: add tests 2023-08-02 10:47:28 +01:00
Amaan Qureshi
b8fe5fe21b fix: do not allow eof to advance states if the new state is the same state 2023-08-02 10:47:27 +01:00
Andrew Hlynskyi
2284eecdc7
Merge pull request #2324 from daumantas-kavolis-sensmetry/api-extensions
Api extensions: previous sibling, last child, lookahead iterator
2023-08-02 01:44:27 +03:00
Andrew Hlynskyi
b9e3cc56d6 chore: apply common approach for api.h defs 2023-08-02 00:33:25 +03:00
Andrew Hlynskyi
1ac134a97d Apply ts_node_is_error in Rust binding 2023-08-02 00:27:19 +03:00
Andrew Hlynskyi
a08c61235d Fix, reference by value for Language as everywhere 2023-08-02 00:04:24 +03:00
Andrew Hlynskyi
759af6d0a4 Remove Copy, Clone from TSLookaheadIterator raw binding struct 2023-08-02 00:04:17 +03:00
Daumantas Kavolis
8c789bf7d5 After review 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
8d5462cea4 LookaheadIterator doesn't need lifetime annotation as it depends on language only 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
fd8fd3f535 Add tests for previous sibling, last child 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
e2c2e39e15 Delete parser and iterator 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
4d6a30a69e Need to check that left row is also non-zero so that columns are not subtracted twice 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
e2094ef202 Add wasm tests for lookahead iterator 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
ab788619ca Split wasm tests for next parse state 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
ec90c215ae Add tests for bidirectional cursor 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
1cb378b445 Add rust tests for lookahead iterator 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
672d38803e Add iteration over names 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
1f52f2f1dc Symbols without aliases should be used for lookahead 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
7267384970 Use step directly 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
c47e217e73 API extensions 2023-08-02 00:02:33 +03:00
Andrew Hlynskyi
08f4e82bb2
Merge pull request #2455 from tree-sitter/regen-bindings
chore: regenerate bindings.rs after #2370
2023-08-01 22:59:25 +03:00
Andrew Hlynskyi
cd1d717551 chore: regenerate bindings.rs after #2370 2023-08-01 21:33:55 +03:00
Amaan Qureshi
981bad03d0
Merge pull request #2454 from amaanq/eof-unused
fix: suppress unused warnings for eof
2023-08-01 09:09:02 -04:00
Amaan Qureshi
614f2f61c8 fix: suppress unused warnings for eof 2023-08-01 12:47:12 +01:00
Andrew Hlynskyi
374b973483
Merge pull request #2452 from tree-sitter/fieldid-non-opt
Restore `children_by_field_id` API to receive non option field id
2023-08-01 13:09:31 +03:00
Andrew Hlynskyi
9df5a686ca
Merge pull request #2451 from tree-sitter/fieldid-unchecked
chore: simply use FieldId::new because it contains id == 0 check
2023-08-01 13:08:11 +03:00
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
3672463df1
Merge pull request #2431 from tree-sitter/text-provider1-fin
Improve TextProvider implementation to allow owned text
2023-08-01 10:40:34 +03:00
Andrew Hlynskyi
19e665ef79 Add tests for TextProvider 2023-08-01 09:12:45 +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
Andrew Hlynskyi
0fb816d1f9
Merge pull request #2441 from tree-sitter/error-contexts
More error contexts + conv panics to errors with context
2023-07-30 21:54:32 +03:00
Andrew Hlynskyi
a2f834d846 More error contexts + conv panics to errors with context 2023-07-30 21:16:45 +03:00
Amaan Qureshi
dbc9da249c
Merge pull request #2440 from ganezdragon/doc-spelling-correction
docs: fix typo
2023-07-29 11:52:31 -04:00
Ganesan Arjuna Maharaja
f9f51480eb correcting the spelling of valid_symbols in indent dedent example 2023-07-29 20:55:33 +05:30
Amaan Qureshi
89c2ab926f
Merge pull request #2437 from amaanq/warn-unused
feat: warn when unused conflicts are present in a grammar
2023-07-28 00:59:35 -04:00
Amaan Qureshi
f4e788b28e
feat: warn when unused conflicts are present in a grammar 2023-07-28 00:23:28 -04:00
Amaan Qureshi
b8f7645ae2
Merge pull request #2434 from amaanq/test-update
fix: retain header and divider delimiter lengths when updating tests
2023-07-27 13:40:53 -04:00
Amaan Qureshi
bff5be9360
Merge pull request #2422 from amaanq/query-err-range-bug
fix: take the last range element by default if the query error isn't found
2023-07-27 13:23:45 -04: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
0787c24a14
Merge pull request #2430 from amaanq/negative-assertions
Negative assertions
2023-07-27 12:44:12 -04:00
Amaan Qureshi
137483c7b9
fix: take the last range element by default if the query error isn't found 2023-07-27 12:34:47 -04:00