Commit graph

5093 commits

Author SHA1 Message Date
Amaan Qureshi
252e2a4bc0 fix: intern a sequence or choice of a single element the same as the element itself 2024-06-21 20:20:02 -04:00
mochalins
3da7deedd8 build(zig): Git ignore updated Zig cache directory 2024-06-10 23:07:50 -04:00
dependabot[bot]
87baf5b689 build(deps): bump the cargo group with 5 updates
Bumps the cargo group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [cc](https://github.com/rust-lang/cc-rs) | `1.0.98` | `1.0.99` |
| [clap](https://github.com/clap-rs/clap) | `4.5.4` | `4.5.7` |
| [regex](https://github.com/rust-lang/regex) | `1.10.4` | `1.10.5` |
| [regex-syntax](https://github.com/rust-lang/regex) | `0.8.3` | `0.8.4` |
| [url](https://github.com/servo/rust-url) | `2.5.0` | `2.5.1` |


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

Updates `clap` from 4.5.4 to 4.5.7
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.4...v4.5.7)

Updates `regex` from 1.10.4 to 1.10.5
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.10.4...1.10.5)

Updates `regex-syntax` from 0.8.3 to 0.8.4
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/regex-syntax-0.8.3...regex-syntax-0.8.4)

Updates `url` from 2.5.0 to 2.5.1
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v2.5.0...v2.5.1)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: regex-syntax
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: url
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-10 22:15:09 -04:00
dependabot[bot]
604d38e6b3 build(deps): bump the cargo group with 2 updates
Bumps the cargo group with 2 updates: [toml](https://github.com/toml-rs/toml) and [wasmparser](https://github.com/bytecodealliance/wasm-tools).


Updates `toml` from 0.8.13 to 0.8.14
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.13...toml-v0.8.14)

Updates `wasmparser` from 0.206.0 to 0.207.0
- [Release notes](https://github.com/bytecodealliance/wasm-tools/releases)
- [Commits](https://github.com/bytecodealliance/wasm-tools/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-04 10:00:23 +02:00
Piotr Osiewicz
3c3699ba90
perf: hoist out common subexpressions in satisfies_text_predicates
This commit stores the result of text predicates evaluation in a separate variable to ensure that they're computed just once. As is, it is possible for e.g. #match predicates to match node against a regex twice.
2024-06-03 14:25:30 +02:00
Amaan Qureshi
6304009209
fix(wasm): update test 2024-06-03 12:42:25 +02:00
Amaan Qureshi
a73191bf0e fix: better error when a supertype rule is invalid 2024-06-03 06:35:27 -04:00
Amaan Qureshi
e553578696 feat: add fuzz subcommand 2024-05-30 23:00:45 -04:00
Amaan Qureshi
7f4a57817d build(deps): bump wasmtime to v21 2024-05-29 18:57:26 -04:00
Amaan Qureshi
fc146ad510 refactor: remove difference dependency 2024-05-25 23:04:28 -04:00
Amaan Qureshi
c440f2a7c6 refactor: remove ansi_term dependency 2024-05-25 21:09:28 -04:00
dependabot[bot]
35c0fad26f build(deps-dev): bump rexml from 3.2.5 to 3.2.8 in /docs
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.5 to 3.2.8.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.2.5...v3.2.8)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-24 22:24:50 -04:00
dependabot[bot]
2653fac99b build(deps-dev): bump nokogiri from 1.16.2 to 1.16.5 in /docs
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.16.2 to 1.16.5.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.16.2...v1.16.5)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-24 22:24:37 -04:00
Max Brunsfeld
38137c71b2 feat!: introduce tree-sitter-language crate for grammar crates to depend on
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-05-24 21:54:07 -04:00
ObserverOfTime
04b9eb5700 feat(bindings): update npm scripts 2024-05-24 17:35:12 -04:00
ObserverOfTime
629395fd58 feat(bindings): add node, python, swift tests 2024-05-24 16:55:05 -04:00
ObserverOfTime
055d0cbd34
feat(dsl)!: support other JS runtimes 2024-05-24 16:53:33 -04:00
ObserverOfTime
d77279d2e3 style(bindings): fix indent & line endings
- Use 2 spaces for parser.c
- Don't force LF line endings
2024-05-24 15:45:48 -04:00
ObserverOfTime
fd0e1c7b5b
feat(bindings): add query constants to python 2024-05-24 15:31:38 -04:00
bfredl
4a8be390f0
feat(zig): update outdated path syntax
Both options are allowed in zig 0.12, but only b.path() in later
versions.
2024-05-23 15:44:52 -04:00
dependabot[bot]
f0ec14ebfd ---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: serde_derive
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- 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-05-21 09:15:27 -04:00
Amaan Qureshi
a88fc9cf63 fix: always reset to the first language when iterating over language attributes 2024-05-19 19:40:47 -04:00
Amaan Qureshi
ae35a36747 fix(lib): a null clock must have tv_nsec be 0 as well 2024-05-19 02:19:37 -04:00
ObserverOfTime
636801770e feat(cli): add debug build flag 2024-05-17 16:12:56 -04:00
dependabot[bot]
20b435363c build(deps): bump the cargo group with 6 updates
Bumps the cargo group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [fs4](https://github.com/al8n/fs4-rs) | `0.8.2` | `0.8.3` |
| [semver](https://github.com/dtolnay/semver) | `1.0.22` | `1.0.23` |
| [serde](https://github.com/serde-rs/serde) | `1.0.200` | `1.0.201` |
| [serde_derive](https://github.com/serde-rs/serde) | `1.0.200` | `1.0.201` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.116` | `1.0.117` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.59` | `1.0.60` |


Updates `fs4` from 0.8.2 to 0.8.3
- [Release notes](https://github.com/al8n/fs4-rs/releases)
- [Commits](https://github.com/al8n/fs4-rs/commits)

Updates `semver` from 1.0.22 to 1.0.23
- [Release notes](https://github.com/dtolnay/semver/releases)
- [Commits](https://github.com/dtolnay/semver/compare/1.0.22...1.0.23)

Updates `serde` from 1.0.200 to 1.0.201
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.200...v1.0.201)

Updates `serde_derive` from 1.0.200 to 1.0.201
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.200...v1.0.201)

Updates `serde_json` from 1.0.116 to 1.0.117
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.116...v1.0.117)

Updates `thiserror` from 1.0.59 to 1.0.60
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.59...1.0.60)

---
updated-dependencies:
- dependency-name: fs4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: semver
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: serde_derive
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-13 23:59:28 -04:00
dependabot[bot]
087bcea02f build(deps): bump the cargo group with 3 updates
Bumps the cargo group with 3 updates: [anyhow](https://github.com/dtolnay/anyhow), [cc](https://github.com/rust-lang/cc-rs) and [webbrowser](https://github.com/amodm/webbrowser-rs).


Updates `anyhow` from 1.0.82 to 1.0.83
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.82...1.0.83)

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

Updates `webbrowser` from 1.0.0 to 1.0.1
- [Release notes](https://github.com/amodm/webbrowser-rs/releases)
- [Changelog](https://github.com/amodm/webbrowser-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/amodm/webbrowser-rs/compare/v1.0.0...v1.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-13 10:10:33 -04:00
Paolo Tranquilli
d35e40185a
fix(rust): fetch CARGO_MANIFEST_DIR at runtime in build script
The `CARGO_MANIFEST_DIR` environment variable should be accessed by
`build.rs` at run time rather than compile time. This was for example
causing issues when importing `tree-sitter` via
[`rules_rust`](https://github.com/bazelbuild/rules_rust) in bazel,
where compilation and running happen in separate environments.
2024-05-13 10:09:58 -04:00
Amaan Qureshi
8e8648afa9 fix(test): multi-grammar corpus tests are now in the repo root 2024-05-06 15:25:42 -04:00
Amaan Qureshi
b1fd3214db feat(cli): bump unicode data to v15.1.0 2024-05-06 15:25:42 -04:00
Amaan Qureshi
6e6dcf1caf test: modernize scanner files 2024-05-05 18:31:53 -04:00
Amaan Qureshi
10e0facb88
docs: remove duplicate pr # in changelog 2024-05-05 17:58:08 -04:00
Amaan Qureshi
9173442dd7
docs: update changelog 2024-05-05 17:49:48 -04:00
Amaan Qureshi
b40f342067
0.22.6 2024-05-05 16:47:18 -04:00
WillLillis
577d333849 feat(cli): add test listing and allow users to parse a specific test number 2024-05-05 16:35:17 -04:00
Amaan Qureshi
33045ee898
fix(test): allow newlines in between test name and attribute 2024-05-05 15:19:42 -04:00
Amaan Qureshi
1e219ff9eb fix(cli): properly account for multi-grammar repos when using docker to build a wasm parser 2024-05-05 14:56:42 -04:00
ObserverOfTime
572cdaa7c0 ci: fix address sanitizer step 2024-05-05 13:06:45 -04:00
ObserverOfTime
6bfdae00f2 docs: mention build command variables 2024-05-05 13:06:45 -04:00
ObserverOfTime
a2d2da314d fix(cli): keep default cc flags in build 2024-05-05 13:06:45 -04:00
Amaan Qureshi
90ba5256d1
fix(highlight): correct signature of ts_highlighter_add_language 2024-05-04 20:35:05 -04:00
Amaan Qureshi
67a043911c
test: temporarily disable php test 2024-05-04 03:05:58 -04:00
Will Lillis
3a42c27061
ci: add nightly rustfmt to workflow 2024-05-02 02:34:39 -04:00
Amaan Qureshi
4c083252ec fix(lib): advance the lookahead end byte by 4 when there's an invalid code point
This helps in the case where an edit was made in the middle of a code
point, but bytes 1-3 are valid, thus we could advance by at most 4 bytes
2024-04-30 20:55:43 -04:00
Amaan Qureshi
61d0395543 fix(lib): do not return field names for extras 2024-04-30 19:23:11 -04:00
WillLillis
946acfd70f feat(cli): support NO_COLOR
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>

This allows users to avoid colored output when NO_COLOR is set to 1.
2024-04-29 20:25:41 -04:00
Amaan Qureshi
5e5026aa73
fix(xtask): always bump every crate in tandem 2024-04-29 00:06:48 -04:00
Amaan Qureshi
627617edb4 refactor(tests): migrate remaining grammar.json tests to grammar.js 2024-04-29 00:01:35 -04:00
Amaan Qureshi
26fa3a76a5 fix(generate): take AsRef<Path> for the path parameter to avoid clones 2024-04-27 17:09:36 -04:00
ObserverOfTime
5aad87a74c fix(generate): don't check arbitrarily named dirs
i.e. check `bindings/swift` rather than `bindings/swift/TreeSitterFoo`
since the dir name may have different casing (e.g. `TreeSitterFOO`)
2024-04-27 17:09:36 -04:00
Amaan Qureshi
41308888fc fix: don't error out on package.json lookup errors if --no-bindings is passed 2024-04-27 16:29:26 -04:00