Commit graph

849 commits

Author SHA1 Message Date
Bedis Nbiba
c7ef6de315
docs(web): provide deno usage information 2024-02-11 03:39:38 -05:00
Amaan Qureshi
697e318a6c fix(wasm): remove C++ mangled symbols
No more upstream scanners use C++ so we're going to encourage to prefer
using C instead. It is just much easier to work with overall
2024-02-09 06:58:56 -05:00
dundargoc
ce191e02c5 fix: use correct printf specifiers 2024-02-08 22:46:43 +01:00
Amaan Qureshi
a969fc428c chore: move dependencies into the workspace and inherit from there 2024-02-08 15:24:09 -05:00
Amaan Qureshi
7980669267 feat: support dot graph output on windows 2024-02-08 15:21:47 -05:00
dundargoc
ff367ebf4c build: enable -pedantic
Co-authored-by: Patrick Thomson <patrickt@github.com>
2024-02-08 16:12:54 +01:00
dundargoc
df1fe842eb docs: various fixes
Closes https://github.com/tree-sitter/tree-sitter/issues/1317.
Closes https://github.com/tree-sitter/tree-sitter/issues/1752.
Closes https://github.com/tree-sitter/tree-sitter/issues/2439.

Co-authored-by: Simon Hengel <sol@typeful.net>
Co-authored-by: Akash Yadav <itsaky01@gmail.com>
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Co-authored-by: Laytan Laats <laytanlaats@hotmail.com>
2024-02-08 00:08:59 +01:00
Thanabodee Charoenpiriyakij
9fb06643f3
docs: fix incorrect Tree::edit example in README.md 2024-02-07 21:24:02 +01:00
Amaan Qureshi
96a440af35 chore(web): add and apply eslint formatting 2024-02-07 12:18:44 -05:00
dundargoc
c8bd6705cf
chore: clippy 2024-02-06 23:34:14 -05:00
dependabot[bot]
3d849cb40e
build(deps): bump bindgen from 0.66.1 to 0.69.4
Bumps [bindgen](https://github.com/rust-lang/rust-bindgen) from 0.66.1 to 0.69.4.
- [Release notes](https://github.com/rust-lang/rust-bindgen/releases)
- [Changelog](https://github.com/rust-lang/rust-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/rust-bindgen/compare/v0.66.1...v0.69.4)

---
updated-dependencies:
- dependency-name: bindgen
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-05 20:16:49 -05:00
Douglas Creager
44aa80d678
feat: include build script links in Rust bindings
This patch updates the Rust binding's build script to output [build
metadata][links].  This makes it easier for downstream crates to
determine the include path, in case they need to compile their own C
code that requires the tree-sitter headers.

[links]: https://doc.rust-lang.org/cargo/reference/build-scripts.html#the-links-manifest-key
2024-02-05 20:05:05 -05:00
Max Brunsfeld
11e73bedc3 Remove unnecessary static lifetime 2024-02-05 11:57:24 -08:00
Max Brunsfeld
f4788b49c0 Merge branch 'master' into wasm-stdlib 2024-02-05 11:55:58 -08:00
Max Brunsfeld
63f34236e3 Add iswxdigit to wasm stdlib 2024-02-05 10:20:27 -08:00
Amaan Qureshi
28bb2a8c1c
chore(lib): apply clippy fixes 2024-02-04 04:18:59 -05:00
Max Brunsfeld
e054de4191 Return an error from build-wasm if scanner uses unavailable functions 2024-02-02 12:04:49 -08:00
Max Brunsfeld
f383b02741 Add iswblank wasm stdlib function 2024-02-02 12:04:49 -08:00
Max Brunsfeld
d2900510f6 Remove duplicate specification of stdlib symbols for web tree-sitter 2024-02-02 12:04:49 -08:00
Max Brunsfeld
e21d9e7f93 Avoid duplication of list wasm stdlib symbol list 2024-02-02 12:00:08 -08:00
Amaan Qureshi
f4c40f6098
fix: do not install parser.h 2024-02-02 11:30:24 -05:00
Amaan Qureshi
8ab14a0ee5
fix(node): update tests 2024-02-02 11:30:24 -05:00
Max Brunsfeld
1d8975319c
Merge pull request #2840 from tree-sitter/language-reference-count
Introduce APIs for managing the lifetimes of languages, allow WASM languages to be deleted
2024-01-30 10:24:37 -08:00
Max Brunsfeld
d351f81b4a Release stale instances from wasm store when languages are dropped 2024-01-29 10:17:49 -08:00
Steven Kalt
d35efd4608
feat(cli): support building WASM via podman
Previously, `tree-sitter build-wasm` had the ability to build WASM
by using docker to pull in an image with a complete emscripten toolchain.
This commit adds the ability to use podman to do the same thing.

Using podman requires two notable changes:
1. Using the fully-qualified image name. Docker defaults to prepending
    `docker.io` to the image name, but podman does not.
2. Podman will mount the `/src/` volume as belonging to root unless
  `--userns=keep-id` is passed. I think podman's different
  volume-ownership is related to podman's daemonless execution and
  `--uidmap` functionality, but I'm not 100% sure.

To test, I ran
```sh
script/fetch-fixtures
script/generate-fixtures
script/generate-fixtures-wasm # <- the important one!
```

which worked as well as the docker version.
2024-01-29 00:50:32 -05:00
Marshall Roch
6eacca9606
fix documentation typos 2024-01-25 20:33:15 -05:00
Max Brunsfeld
c4142737ec Merge branch 'master' into language-reference-count 2024-01-25 12:43:56 -08:00
Amaan Qureshi
98be227227
0.20.9 2024-01-25 15:05:17 -05:00
Max Brunsfeld
3c66dd2d6c Add missing language return in ts_query_new
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Joseph <joseph@zed.dev>
2024-01-25 11:06:54 -08: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
Max Brunsfeld
31c4044974 Bump wasmtime to v16 release 2023-12-31 11:33:28 -08:00
Max Brunsfeld
675da7bfe8 Free C error message properly when loading wasm language fails 2023-12-31 10:05:42 -08:00
Max Brunsfeld
4a8e4b1963 Allow wasm languages to be deleted 2023-12-27 15:00:16 -08:00
Max Brunsfeld
da16cb1459 Introduce language ref-count management C APIs, remove Copy impl for Language in Rust 2023-12-27 14:59:16 -08:00
Max Brunsfeld
68ba9a4d66 Grow memory dynamically as-needed when loading wasm language modules 2023-12-03 12:12:47 -08:00
Max Brunsfeld
f2285b43ea Fix crash when failing to instantiate wasm stdlib module 2023-12-03 11:42:03 -08:00
Max Brunsfeld
09b522ece2 Fix another bug in subtree_compare
When subtrees differ, exit loop before pushing children to the stack.
2023-11-30 11:10:33 -08:00
Andrew Hlynskyi
d56b51a11d
Revert "Alt #2454" 2023-11-29 11:20:05 +02: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
034f0d0280
Merge pull request #1864 from tree-sitter/wasm-language
Add optional WASM feature to the native library, allowing it to run wasm-compiled parsers via wasmtime
2023-11-28 12:08:47 -08:00
Max Brunsfeld
13dd76e444 Return an informative error on failing to construct a WasmStore 2023-11-27 17:48:29 -08:00
Andrew Hlynskyi
0d26309c41
Revert "chore(lib): fix fields naming in QueryPattern to singular" 2023-11-28 02:30:01 +02:00
Max Brunsfeld
5e2456c2f2 Avoid using recursion for ts_subtree_compare
This can lead to stack overflow crashes.
2023-11-27 11:35:33 -08:00
Max Brunsfeld
6fd7a1e44e Return informative error when load_language fails 2023-11-26 12:15:05 -08:00
Max Brunsfeld
e9289d3b30 Fix error when wrong language name is passed to load_language 2023-11-24 20:25:28 -08:00
Max Brunsfeld
b59716600a Add a test that loads multiple languages in a wasm store 2023-11-24 20:03:54 -08:00
Max Brunsfeld
359317f876 Determine sizes of static wasm arrays from subsequent static pointers 2023-11-24 11:32:24 -08:00
Max Brunsfeld
97800e0ec8 Advance wasm store's mem + table offsets when adding a language 2023-11-19 12:26:59 -08:00
Amaan Qureshi
0ff28346be
Merge pull request #2714 from MrPrezident/test_point_range_captures_fix
fix "test_point_range_captures not working"
2023-11-12 21:09:09 -08:00