WillLillis
5b5cf5a5e5
fix(lib): check point, byte ranges in ts_query_cursor_set
...
range functions
2024-11-02 03:06:07 -04:00
ObserverOfTime
ac37e60559
refactor(web): use fs/promises
2024-10-15 16:10:23 +00:00
Amaan Qureshi
3f424c0121
feat: add an API to time out query executions
...
Currently, if a predicate is hard to match on the Rust side, a sizable
query against a very large file can take forever, and ends up hanging.
This commit adds an API function `ts_query_cursor_set_timeout_micros` to
limit how long query execution is allowed to take, thereby negating the
chance of a hang to occur.
2024-08-31 14:33:28 -04:00
Amaan Qureshi
96d18408a3
refactor(js): misc fixes & tidying
2024-04-11 22:35:43 -04:00
Amaan Qureshi
09d2b23a64
fix(lib): account for the root node of a tree cursor being an alias
2024-03-20 19:23:08 -04:00
Amaan Qureshi
5c2f80ebb0
fix(bindings/wasm): fix Parser.getIncludedRanges()
2024-03-12 02:29:35 -04:00
Amaan Qureshi
728793a160
feat(wasm)!: keep API in-line with upstream and start aligning with node
2024-03-10 03:02:17 -04:00
Boris Verkhovskiy
c070c92722
refactor(wasm)!: make current*, is*, and has* methods properties
2024-03-08 00:27:06 -05:00
Amaan Qureshi
4303ab99c9
fix: properly handle Query.matches when filtering out results
2024-02-13 16:40:05 -05:00
Amaan Qureshi
96a440af35
chore(web): add and apply eslint formatting
2024-02-07 12:18:44 -05:00
Amaan Qureshi
ef5621c0e2
Merge pull request #2795 from savetheclocktower/fix-quantified-predicates
...
fix: Handle quantified predicates on `web-tree-sitter` properly
2024-01-25 13:31:40 -05:00
Andrew Dupont
642679f32a
Simplify flags
2023-11-28 14:08:16 -08:00
Andrew Dupont
24e41d2bb7
fix: Handle quantified predicates on web-tree-sitter properly
...
Test cases for all new predicates added in #2532
2023-11-28 13:07:32 -08:00
Max Brunsfeld
f4e2f68f14
Merge branch 'master' into wasm-language
2023-10-27 12:11:43 +01:00
Amaan Qureshi
09ac28c77d
feat!: properly handle predicates used on quantified captures
2023-08-31 16:01:36 -04:00
Amaan Qureshi
7d953eb5ba
Merge pull request #2466 from tom95/add-field-name-for-child
...
Web Bindings: Expose fieldNameForChild C function
2023-08-18 12:20:39 -04:00
Andrew Hlynskyi
26c3ae7b98
Rename: ts_lookahead_iterator_advance -> ts_lookahead_iterator_next
2023-08-09 14:40:29 +03:00
Tom Beckmann
b407b5588d
binding_web: expose Node.fieldNameForChild(index) function
2023-08-03 16:02:51 +02:00
Daumantas Kavolis
e2094ef202
Add wasm tests for lookahead iterator
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
c47e217e73
API extensions
2023-08-02 00:02:33 +03:00
Max Brunsfeld
35ce2e47ec
web: Remove conditional logic for older emscripten versions
2022-11-15 17:27:01 -08:00
Andrew Hlynskyi
79b2bf1c30
fix(wasm): Fix predicates in alternations, resolves #1392
2021-09-21 21:13:41 +03:00
Johannes Rieken
12d727fd49
mix init options in the Module-global
2021-08-30 14:16:41 +02:00
Douglas Creager
ad3907c2a6
wasm: Add matchLimit option to query methods
...
This exposes the new configurable match limits for query cursors.
2021-06-02 13:51:00 -04:00
Douglas Creager
04c2aa973b
binding_web: Call correct function to reset parser
2021-05-03 14:25:57 -04:00
Douglas Creager
b742e88108
Use TRANSFER_BUFFER for did_exceed_match_limit
...
This bridges the gap between how the C API reports this for a query
cursor, but the wasm API defines the method on a query. Whenever you
call a query method that might exceed the match limit, we call the C API
function and transfer the result across the wasm boundary, storing the
result in the JavaScript wrapper class.
2021-04-28 15:46:12 -04:00
Douglas Creager
e8eb3c5d5a
binding_web: Add Query.didExceedMatchLimit
...
This lets wasm clients check whether a query exceeded its maximum number
of in-progress matches.
2021-04-27 09:21:38 -04:00
Jon Bockhorst
1e9481dc48
Web bindings: fix descendantsOfType memory allocation
2021-03-13 22:28:10 -06:00
Max Brunsfeld
41e9af2456
Avoid including undefined in return value of Query.matches
...
Fixes #932
2021-02-26 15:16:07 -08:00
Max Brunsfeld
f462f0d09d
Fix small issues with new wasm bindings
2021-02-05 10:18:37 -08:00
hvithrafn
752372ee09
Add several bindings for Language
2021-02-01 13:01:10 -07:00
hvithrafn
c994adbf61
Modify Language.load to accept bytes directly
2021-01-25 02:06:47 -07:00
hvithrafn
6557564b92
Add a non-default export for Parser
2021-01-21 20:37:46 -07:00
Max Brunsfeld
5008700735
wasm: Look for both loadWebAssemblyModule and loadSideModule
...
See https://github.com/emscripten-core/emscripten/pull/12969
2020-12-04 14:36:32 -08:00
Max Brunsfeld
b118e7d750
Make binding.js syntactically valid
...
Put the end of the surrounding closure into a separate file, suffix.js.
2020-11-30 15:28:26 -08:00
Max Brunsfeld
a2d6048226
Get the wasm build working w/ latest emscripten
2020-11-30 14:28:27 -08:00
Joel Spadin
7ef73b2e08
web binding: fix equals()
...
Node.equals() used to always return true. Now it works.
Also added unit tests for it.
2020-11-26 14:43:27 -06:00
Max Brunsfeld
9daec9cb22
Tweak impossible pattern error messages
2020-08-20 13:35:11 -07:00
Max Brunsfeld
1ea29053e1
Merge branch 'master' into query-pattern-is-definite
2020-08-14 09:31:55 -07:00
Max Brunsfeld
1ae5cbc851
query: Handle #not-match? in rust, wasm bindings
2020-07-24 12:15:23 -07:00
Max Brunsfeld
7f955419a8
Start work on recognizing impossible patterns
2020-06-25 15:06:27 -07:00
Max Brunsfeld
28a779d6a0
wasm: Allow arbitrary predicates in queries
2020-06-01 13:28:52 -07:00
Max Brunsfeld
40993195b8
Fix wasm tests on CI ( #616 )
...
* wasm: Improve error message on missing language symbol
* Fix source file existence checks in build-wasm command
2020-05-13 15:14:43 -07:00
Max Brunsfeld
fce5c50f81
Fix wasm query tests
2020-05-11 16:19:42 -07:00
Andy Pan
1635aab801
Fix exporting get/set timeout in web binding ( #592 )
...
* Fix exporting get/set timeout in web binding
Add two symbols "_ts_parser_set_timeout_micros", "_ts_parser_timeout_micros" due to usage in `tree-sitter.js`.
* Fix getTimeoutMicros() not returning the value
2020-04-11 08:21:59 -07:00
Max Brunsfeld
96c060fc6d
wasm: Fix typo in Node.typeId
2020-02-21 17:06:07 -08:00
Max Brunsfeld
33492ca9df
query: Add not-eq? predicate in rust & wasm binding
2020-02-19 21:36:30 -08:00
Max Brunsfeld
9ea3668f75
wasm: Fix logic for finding language functions
2019-11-20 11:10:49 -08:00
Emily Marigold Klassen
1d2f171067
binding_web: fix typo in fieldNameForId ( #481 )
2019-11-08 21:55:08 -08:00