Commit graph

322 commits

Author SHA1 Message Date
Max Brunsfeld fab8540508 libs: 0.20.3 2022-01-21 16:35:37 -08:00
Owen Shepherd 1aa6541476
Add realloc to wasm exports 2022-01-03 16:07:39 +00:00
Max Brunsfeld 5d8a1ace56 web: 0.20.2 2021-12-30 17:14:04 -08:00
Max Brunsfeld 224e79ca27 web: Fix script directory that's passed to locateFile 2021-11-22 15:56:26 -08:00
Max Brunsfeld 42360fc003 Bump library versions to 0.20.1 2021-11-21 12:33:12 -08:00
Andrew Hlynskyi 79b2bf1c30 fix(wasm): Fix predicates in alternations, resolves #1392 2021-09-21 21:13:41 +03:00
Max Brunsfeld 5c2ebf093b Include memmove symbol in wasm build 2021-09-10 15:21:55 -07:00
Max Brunsfeld 0e26fbe5e6
Merge pull request #1367 from jrieken/moduleInit
Allow to pass Module object to init-function
2021-08-30 09:32:43 -07:00
Max Brunsfeld eeda44d837
Merge pull request #1368 from jrieken/dtsTweaks
Fixes and additions to tree-sitter-web.d.ts
2021-08-30 09:17:53 -07:00
Johannes Rieken 3e9874df7f Don't confuse terser with object spread 2021-08-30 14:56:28 +02:00
Johannes Rieken e7a8e73bbf fixes and additions to tree-sitter-web.d.ts 2021-08-30 14:47:47 +02:00
Johannes Rieken 12d727fd49 mix init options in the Module-global 2021-08-30 14:16:41 +02:00
Andrew Hlynskyi f15700c6bd chore(web): Add the LICENSE file to the web-tree-sitter npm package 2021-08-22 03:13:46 +03:00
Max Brunsfeld be69777350 libs: 0.20.0 2021-06-29 17:18:22 -07:00
Andrew Hlynskyi a286f831c7 Bump Emscripten version to 2.0.24 2021-06-30 01:06:33 +03: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
Max Brunsfeld 9d0eedc01f Remove stray entry from wasm exported-symbol list 2021-05-20 14:33:25 -07:00
Max Brunsfeld 242e089379 web: 0.19.4 2021-05-20 14:29:39 -07:00
Douglas Creager 6abf77a20c web: 0.19.3 2021-05-13 15:14:56 -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
Max Brunsfeld 2a99108171 web: 0.19.2 2021-03-18 10:36:05 -07:00
Jon Bockhorst 1e9481dc48 Web bindings: fix descendantsOfType memory allocation 2021-03-13 22:28:10 -06:00
Max Brunsfeld 0818892a1a libs: 0.19.1 2021-03-05 15:31:48 -08:00
Max Brunsfeld 22fb88e89d Bump library versions to 0.19 2021-03-01 14:46:43 -08: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 28fd8b3371 web: 0.18.1 2021-02-10 16:22:51 -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 d6a3e4c98c
Merge pull request #847 from hponde/patch-1
Update binding_web/README.md releases link
2020-12-14 12:28:29 -08:00
Max Brunsfeld d6cfe3ed1d web: 0.18 2020-12-11 15:57:32 -08:00
Henrique Oliveira Pinto f025f9aa71
Point directly to releases/latest 2020-12-11 17:58:47 -05:00
Henrique Oliveira Pinto 4336d9c8c5
Update binding_web/README.md releases link
The previous link pointed to a specific version and it made me think that the project had no releases for a year!
2020-12-11 17:57:15 -05:00
Max Brunsfeld 0f492e4254 Include ts_tree_copy in wasm build
Fixes #846
2020-12-11 13:48:22 -08: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 5139d81e54
Merge pull request #622 from skovhus/patch-1
TypeScript: Correct SyntaxNode isNamed type
2020-11-03 10:34:27 -08:00
Stafford Brunk 2f897b4d73
Change QueryResult to be QueryCapture and QueryMatch
matches/captures return 2 different types of object so this change corrects the return types
2020-11-03 08:20:20 -07:00
Stafford Brunk a7a6139e70
Add additional Query API typedefs based on Elm Language Server's overrides 2020-10-30 10:20:12 -06:00
Stafford Brunk 505695040d
Update TS definitions to support the Query API 2020-10-30 06:58:13 -06:00
Max Brunsfeld 7565604626 web: 0.17.1 2020-09-24 15:06:19 -07:00
Max Brunsfeld 9185262e48 web: 0.17.0 2020-09-23 13:17:35 -07: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 b57bd59ed4 web: 0.16.4 2020-06-01 13:47:28 -07:00
Max Brunsfeld 28a779d6a0 wasm: Allow arbitrary predicates in queries 2020-06-01 13:28:52 -07:00
Kenneth Skovhus 02196f8ae9
Correct SyntaxNode isNamed type 2020-05-17 20:33:53 +02: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 d7a188ce7f web: 0.16.3 2020-05-12 16:22:11 -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 75a910229b web: 0.16.2 2020-03-02 15:05:50 -08:00
Max Brunsfeld 415053213f web: 0.16.1 2020-03-02 12:48:00 -08: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 e313f981a2 wasm: 0.16.0 2019-12-10 16:26:20 -08:00
Max Brunsfeld d25b71182e Update bash unit test to reflect field additions 2019-12-10 14:12:45 -08:00
Max Brunsfeld 71998ef3c1 web: 0.15.11 2019-11-20 11:12:50 -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
George Fraser 1346929e66 Parser.Language.load takes a path (#471) 2019-10-23 08:53:15 -07:00
Max Brunsfeld 4af16dc0ac web: 0.15.10 2019-10-22 13:00:51 -07:00
Max Brunsfeld f736cb3896 web: Implement TreeCursor.nodeText
Refs #466
2019-10-22 12:58:27 -07:00
Max Brunsfeld 7ccec8c0e2 Tweak wasm binding to work with new upstream LLVM backend 2019-10-21 16:10:29 -07:00
Max Brunsfeld 060e00463d Implement include-children directive in injection queries 2019-10-14 17:38:42 -07:00
Ika 979b46e297 fix(web-tree-sitter): add missing types 2019-10-04 20:16:13 +08:00
Max Brunsfeld 27149902f8 Handle is?, is-not?, and set! predicate functions in queries 2019-09-25 10:21:20 -07:00
Max Brunsfeld b15e90bd26 Handle set! predicate function in queries 2019-09-24 11:54:24 -07:00
Max Brunsfeld b79839b599 Use a more realistic example in one JS query unit test 2019-09-16 12:48:01 -07:00
Max Brunsfeld d4d554b2ae Add wasm bindings for predicates 2019-09-16 10:25:44 -07:00
Max Brunsfeld 096126d039 Allow predicates in queries, to match on nodes' text 2019-09-15 22:06:51 -07:00
Max Brunsfeld 307a1a6c11 Avoid wasm calls in Node.startIndex and Node.startPosition 2019-09-13 15:38:30 -07:00
Max Brunsfeld a1fec71b19 Tweak QueryCursor to allow iterating either matches or captures
For syntax highlighting, we want to iterate over all of the captures in 
order, and don't care about grouping the captures by pattern.
2019-09-13 15:19:04 -07:00
Max Brunsfeld 49ce2fddb9 Add wasm binding for running tree queries in a limited range 2019-09-12 12:14:04 -07:00
Max Brunsfeld 67dcbc3e73 Detect error when a prefix of a valid node name is used in a query 2019-09-11 21:23:46 -07:00
Max Brunsfeld c71de5bd81 Tweak query interface
* Rename TSQueryContext -> TSQueryCursor
* Remove the permanent association between the cursor and its query. The 
cursor can now be used again for a different query.
2019-09-11 17:33:48 -07:00
Max Brunsfeld c8c75782e3 Allow tree queries to execute within a limited range 2019-09-11 16:49:29 -07:00
Max Brunsfeld 60467ae701 Fix bugs in binary search used in tree queries 2019-09-10 22:30:27 -07:00
Max Brunsfeld 52cda5f541 Start work on wasm binding to query API 2019-09-10 20:54:21 -07:00
Max Brunsfeld 82fab90c0b web: Add bindings for remaining field APIs 2019-09-04 09:30:36 -07:00
Max Brunsfeld 52126a6606 Update JS test to reflect typescript grammar changes 2019-08-08 10:23:17 -07:00
Max Brunsfeld 9848ceb3e2 wasm: Fix infinite loop in Node.text when tree and text are out-of-sync 2019-07-31 13:55:15 -07:00
Max Brunsfeld 3714e330d3 wasm: 0.15.9 2019-07-29 17:19:52 -07:00
Max Brunsfeld 56f30ac06f wasm: 0.15.8 2019-07-23 11:20:24 -07:00
Stafford Brunk ce10b53fe3
Add missing currentFieldName() to TreeCursor 2019-07-23 06:47:44 -06:00
Stafford Brunk d686d24563
Add missing delete() to TreeCursor 2019-07-23 06:47:44 -06:00
Stafford Brunk e5ee59c051
Correct currentNode on TreeCursor
It's a method not a getter in this implementation
2019-07-23 06:47:44 -06:00
Max Brunsfeld 443ac1c1e5 Update python tests to reflect grammar changes 2019-07-22 09:55:30 -07:00
Max Brunsfeld 311fc51e8a wasm: 0.15.7 2019-07-17 15:19:53 -07:00
Max Brunsfeld 5289e009c1 wasm: Add descendantsOfType to typescript interface 2019-07-17 08:59:14 -07:00
Max Brunsfeld f00b310908 wasm: Implement Node.descendantsOfType 2019-07-17 08:58:46 -07:00
Stafford Brunk 6340c820c1
Add missing copy() and getLanguage() calls to Tree web types 2019-07-16 20:42:57 -06:00
Stafford Brunk 3953cb317f
Add delete() to Parser and Tree web types 2019-07-16 20:39:57 -06:00
Max Brunsfeld 1a33f1a665 Add TreeCursor.currentFieldName to wasm binding 2019-07-10 14:31:10 -05:00
Max Brunsfeld c90a532d8f Update tests to reflect javascript grammar changes 2019-07-10 14:30:43 -05:00
Max Brunsfeld f2b13721d9 Update wasm test to reflect C++ grammar changes 2019-07-05 12:13:38 -07:00
Sebastián Gurin bd97ad5c4c Wasm file generation note in readme (#368)
* readme .wasm file generate and usage in node.js

* generate wasm language files readme note
2019-06-20 14:06:09 -07:00
Max Brunsfeld 3a51b23f1a web: 0.15.6 2019-06-03 16:19:16 -07:00
Max Brunsfeld 1cef6d4550 web: Don't require Parser.init to be called immediately 2019-06-03 16:18:49 -07:00
Max Brunsfeld 790b5558be web: 0.15.5 2019-05-31 11:14:45 -07:00
Max Brunsfeld e58b69e3b8 Include type declarations in npm tarball 2019-05-31 11:14:29 -07:00
Max Brunsfeld 2084745152 0.15.4 2019-05-31 10:43:42 -07:00
Max Brunsfeld f5163126c8 generate-fixtures-wasm: handle language repos w/ multiple grammars
Refs tree-sitter/tree-sitter-typescript#68
2019-05-30 12:34:03 -07:00
Max Brunsfeld 659f2825ba
Merge pull request #342 from georgewfraser/patch-1
Add type definitions
2019-05-28 15:31:23 -07:00
George Fraser 0fe67dc8b4 Dedent 2019-05-28 23:01:41 +01:00
Max Brunsfeld 6055108936 Wasm: 0.15.3 2019-05-28 13:00:17 -07:00
Max Brunsfeld 068f7b1a0c Wasm: Throw an exception if Parser is constructed before init() resolves 2019-05-28 12:59:00 -07:00
George Fraser d4597e14f4
Reference tree-sitter-web.d.ts in package.json 2019-05-27 15:10:43 +01:00
George Fraser a0d0ba9709
Add type definitions
This is based on https://github.com/tree-sitter/node-tree-sitter/blob/master/tree-sitter.d.ts with slight modifications because web-tree-sitter has a slightly different interface than node-tree-sitter
2019-05-27 15:08:29 +01:00
Federico 51345f3ea2 Ensure Point has column typeof number field 2019-05-24 14:34:04 +02:00
Max Brunsfeld 3ec91a8d8a Wasm: When in node, use fs APIs to load language wasm files
Fixes #338
2019-05-23 16:12:32 -07:00
Max Brunsfeld 0d70b485c0 Implement Wasm binding for Tree.getChangedRanges() 2019-05-09 23:52:57 -07:00
Max Brunsfeld 9fc058656c In binding_web, use prepublishOnly, not prepublish 2019-05-07 13:24:29 -07:00
Max Brunsfeld 9a82bd9d83 Set up code to publish web bindings to npm 2019-05-07 13:11:04 -07:00
Max Brunsfeld 3fc459a84b Reorganize language bindings
* Move rust binding: lib/binding -> lib/binding_rust
* Move wasm bindinig: lib/web -> lib/binding_web
* Add wasm readme
2019-05-07 10:41:49 -07:00