Commit graph

4962 commits

Author SHA1 Message Date
Max Brunsfeld
09b18fad5b
Merge pull request #3181 from tree-sitter/handle-wasm-oom
When loading languages via WASM, gracefully handle memory errors and leaks in external scanners
2024-03-18 13:15:06 -07:00
Max Brunsfeld
096ad4669b Return to using master branch of tree-sitter-html in tests 2024-03-18 13:14:52 -07:00
Max Brunsfeld
7b40eb1dd2 Add a simple dockerfile for testing
Co-authored-by: Marshall <marshall@zed.dev>
2024-03-18 12:35:10 -07:00
Max Brunsfeld
210a032f59 Temporarily use a branch of the HTML parser for testing 2024-03-18 10:58:42 -07:00
JonCoole
d569d0ea6a
docs: add NGINX grammar
Added the NGINX tree-sitter repository to the index.md list
2024-03-17 19:01:37 -04:00
Max Brunsfeld
4676cd4200 Defer creation of external scanner until the beginning of parse 2024-03-17 10:20:25 -07:00
Max Brunsfeld
fed9b98d6c Clean up wasm store construction, avoid hard-coding initial memory size
Retrieve the initial memory size from the stdlib's memory import type.
2024-03-17 10:20:18 -07:00
Max Brunsfeld
7a9b3076ef Handle memory errors occurring in wasm scanners
* In WASM, use a custom, simple malloc implementation that lets us
  expicitly reset the heap with a new start location.
* When a WASM call traps or errors, propagate that as a parse failure.
* Reset the WASM heap after every parse.

Co-authored-by: Conrad <conrad@zed.dev>
2024-03-17 10:19:42 -07:00
Max Brunsfeld
b19d85aca7 Remove logic for building with clang static analyzer in core rust binding 2024-03-17 09:59:51 -07:00
Max Brunsfeld
a85a61e56f Update test script to allow running w/ asan on mac 2024-03-17 09:59:51 -07:00
Amaan Qureshi
fc15f62133
0.22.2 2024-03-17 07:31:58 -04:00
ObserverOfTime
4bbaee2f56 fix(lib): allow hiding symbols 2024-03-17 07:21:06 -04:00
ObserverOfTime
4b12eab927 feat(lib): implement Display for Node 2024-03-17 06:12:28 -04:00
Amaan Qureshi
e8dbe011d3 test: fix header writes 2024-03-17 05:36:30 -04:00
Amaan Qureshi
754aa62e89 chore: turbofish styling 2024-03-17 05:36:30 -04:00
Amaan Qureshi
99b93d83a1 feat(cli)!: add a separate build command to compile parsers
This allows users to build parsers without having to run `test` or
`parse` to invoke the compilation process, and allows them to output the
object file to wherever they like. The `build-wasm` command was merged
into this by just specifying the `--wasm` flag.
2024-03-17 05:36:30 -04:00
dundargoc
a1c39d4760 ci: simplify workflows 2024-03-16 19:54:54 -04:00
Stachu Korick
ca7d15add6
docs(license): update year 2024-03-16 01:15:22 -04:00
Amaan Qureshi
30fd71f5ac fix(lib): avoid possible UB of calling memset on a null ptr when 0 is passed into array_grow_by 2024-03-13 00:02:53 -04:00
ObserverOfTime
1ff40f5571 fix(lib): makefile installation 2024-03-12 18:14:58 -04:00
Amaan Qureshi
81d90c7cd8 fix(lib): makefile installation on macOS 2024-03-12 15:53:31 -04:00
Max Brunsfeld
2ff746742f
Merge pull request #3172 from tree-sitter/remove-which-crate
Remove dependency on which crate
2024-03-12 12:38:48 -07:00
Max Brunsfeld
99a720c968 Remove dependency on which crate 2024-03-12 12:19:27 -07:00
Max Brunsfeld
7687d88402
Merge pull request #3169 from helix-editor/lower-lib-msrv
Lower the lib's MSRV
2024-03-12 12:17:24 -07:00
Michael Davis
c0185dd635
Lower the lib's MSRV 2024-03-12 09:36:54 -04:00
Giftpflanze
647d2e5c37
docs: fix typo 2024-03-12 02:29:55 -04:00
Amaan Qureshi
5c2f80ebb0 fix(bindings/wasm): fix Parser.getIncludedRanges() 2024-03-12 02:29:35 -04:00
Amaan Qureshi
ad07fa8a9e feat(bindings/rust): expose Parser::included_ranges 2024-03-12 02:29:35 -04:00
Andreas Schneider
d4862ff9f7
build(lib): allow overriding CFLAGS on the commandline
If you package tree-sitter for a distribution, the distribution is
setting the CFLAGS which should be used for all packages.  Allow those
flags to be used.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2024-03-12 01:50:56 -04:00
dependabot[bot]
2e596e379e ci: bump the actions group with 1 update
Bumps the actions group with 1 update: [softprops/action-gh-release](https://github.com/softprops/action-gh-release).


Updates `softprops/action-gh-release` from 1 to 2
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-12 01:45:19 -04:00
dependabot[bot]
926944becd build(deps): bump the cargo group with 1 update
Bumps the cargo group with 1 update: [toml](https://github.com/toml-rs/toml).


Updates `toml` from 0.8.10 to 0.8.11
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.10...toml-v0.8.11)

---
updated-dependencies:
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-12 01:45:11 -04:00
Amaan Qureshi
516f13e89e docs: update changelog 2024-03-12 01:14:37 -04:00
Amaan Qureshi
1c38d34dea
0.22.1 2024-03-10 17:59:12 -04:00
Amaan Qureshi
cdc9fbb240
fix: cli build script behavior on release 2024-03-10 17:53:35 -04:00
Amaan Qureshi
0a5a564ea7
0.22.0 2024-03-10 17:15:08 -04:00
ObserverOfTime
e9b3f65ceb fix(bindings): fix template oversights 2024-03-10 15:48:23 -04:00
Christopher Durham
78cc77e7b2 refactor!: remove redundant escape regex & curly brace regex preprocessing
The regex-syntax crate now natively supports literal escapes for all
ASCII characters except those in [0-9A-Za-z<>].
2024-03-10 14:47:11 -04:00
Nathan M
aa0f3c21b1
docs: add discord and matrix badges 2024-03-10 11:28:14 -04:00
ObserverOfTime
b60b2489aa feat(bindings): remove dsl types file 2024-03-10 10:06:17 -04:00
ObserverOfTime
072865e450 feat(bindings): add prebuildify to node
Co-Authored-By: Amaan Qureshi <amaanq12@gmail.com>
2024-03-10 10:06:17 -04:00
ObserverOfTime
69cf13bc05 feat(bindings): add peerDependencies for npm 2024-03-10 10:06:17 -04:00
Amaan Qureshi
17e50c4c57 fix: allow the regex v flag 2024-03-10 09:50:29 -04:00
Amaan Qureshi
2e56e94648 build: remove unused deps, bump deps, and bump MSRV to 1.74.1 2024-03-10 09:47:39 -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
4b578a3649 fix(generate): camel case name in Cargo.toml description 2024-03-06 19:53:51 -05:00
ObserverOfTime
2d652c90a7 fix(cli): only output the sources with --no-bindings 2024-03-06 13:56:40 -05:00
dependabot[bot]
7171ecd4ad build(deps): bump the cargo group with 4 updates
Bumps the cargo group with 4 updates: [cc](https://github.com/rust-lang/cc-rs), [indexmap](https://github.com/indexmap-rs/indexmap), [libloading](https://github.com/nagisa/rust_libloading) and [walkdir](https://github.com/BurntSushi/walkdir).


Updates `cc` from 1.0.88 to 1.0.89
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Commits](https://github.com/rust-lang/cc-rs/compare/1.0.88...1.0.89)

Updates `indexmap` from 2.2.4 to 2.2.5
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.2.4...2.2.5)

Updates `libloading` from 0.8.1 to 0.8.2
- [Commits](https://github.com/nagisa/rust_libloading/compare/0.8.1...0.8.2)

Updates `walkdir` from 2.4.0 to 2.5.0
- [Commits](https://github.com/BurntSushi/walkdir/compare/2.4.0...2.5.0)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: libloading
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: walkdir
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-06 01:27:41 -05:00
Amaan Qureshi
92675117a6 fix(generate): extern allocator functions for the template don't need to be "exported" 2024-03-05 11:19:06 -05:00
Amaan Qureshi
54a31069af fix: parsers should export the language function on windows 2024-03-05 11:19:06 -05:00