@willbooster/tree-sitter-haskell 2.1.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -7
- package/grammar/externals.js +1 -0
- package/grammar/id.js +1 -1
- package/grammar/type.js +1 -1
- package/package.json +3 -3
- package/tree-sitter-haskell.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -13,8 +13,7 @@ Haskell grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), f
|
|
|
13
13
|
to its authors and contributors. This is not an official release of that project.
|
|
14
14
|
|
|
15
15
|
This fork is based on upstream's version 0.23.1 grammar and generates the parser with the
|
|
16
|
-
[WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter) generator. The parser carries that fork's own ABI number, so it loads only with that fork's runtime, version
|
|
17
|
-
or later; upstream's runtime rejects it.
|
|
16
|
+
[WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter) generator. The parser carries that fork's own ABI number, so it loads only with that fork's runtime, version 4.0.2 or later in the 4.x series; upstream's runtime rejects it.
|
|
18
17
|
[Upstream's README at that version](https://github.com/tree-sitter/tree-sitter-haskell/blob/v0.23.1/README.md) lists
|
|
19
18
|
the supported language extensions and, under "Querying", explains how to query the grammar's supertypes; it is the
|
|
20
19
|
readme that the comments in `grammar.js` refer to.
|
|
@@ -43,7 +42,7 @@ reports an error: the lexers of the WillBooster/tree-sitter generator let charac
|
|
|
43
42
|
## Usage
|
|
44
43
|
|
|
45
44
|
The npm package ships `tree-sitter-haskell.wasm` for
|
|
46
|
-
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version
|
|
45
|
+
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 4.0.2 or later in the 4.x series, which runs in Node.js, Bun, browsers, and Cloudflare Workers. In Node.js and Bun, load the grammar from its path:
|
|
47
46
|
|
|
48
47
|
```js
|
|
49
48
|
import { fileURLToPath } from 'node:url';
|
|
@@ -89,8 +88,8 @@ fuzzed with:
|
|
|
89
88
|
|
|
90
89
|
```toml
|
|
91
90
|
[dependencies]
|
|
92
|
-
tree-sitter = { package = "willbooster-tree-sitter", version = "
|
|
93
|
-
tree-sitter-haskell = { package = "willbooster-tree-sitter-haskell", version = "
|
|
91
|
+
tree-sitter = { package = "willbooster-tree-sitter", version = "4.0.2" }
|
|
92
|
+
tree-sitter-haskell = { package = "willbooster-tree-sitter-haskell", version = "3" }
|
|
94
93
|
```
|
|
95
94
|
|
|
96
95
|
```rust
|
|
@@ -128,8 +127,7 @@ and the release build regenerate the parsers before compiling them.
|
|
|
128
127
|
- the corpus in `test/corpus`, with the native build and with the Wasm build (the first run downloads the WASI SDK);
|
|
129
128
|
- an incremental-parsing check (`test/unit/incremental.test.ts`): `script/fuzz-corpus` runs `tree-sitter fuzz`, which
|
|
130
129
|
edits each corpus case at random, reparses it, undoes the edits, and reparses again. `TREE_SITTER_SEED`,
|
|
131
|
-
`TREE_SITTER_ITERATIONS`, and `TREE_SITTER_EDITS` run other or more edits
|
|
132
|
-
upstream's own parser also reparses differently from a fresh parse (see `script/fuzz-corpus`);
|
|
130
|
+
`TREE_SITTER_ITERATIONS`, and `TREE_SITTER_EDITS` run other or more edits;
|
|
133
131
|
- a check that the real-world Haskell files in `examples/`, the checked-in ones and those of the cloned repositories, fail to
|
|
134
132
|
parse exactly as listed in `script/known-failures.txt`; upstream's prebuilt parser fails on the same files. The first run clones the repositories. The example repositories are pinned to commits in
|
|
135
133
|
`script/parse-examples`. After a grammar change or a moved pin alters that list, `script/parse-examples` rewrites it;
|
package/grammar/externals.js
CHANGED
package/grammar/id.js
CHANGED
|
@@ -68,7 +68,7 @@ module.exports = {
|
|
|
68
68
|
_tyconids: $ => choice($._qtyconid, $._tyconid),
|
|
69
69
|
|
|
70
70
|
_tycon_arrow: $ => parens($, alias($._arrow, $.operator)),
|
|
71
|
-
_qualified_arrow: $ => qualified($, alias($._arrow, $.operator)),
|
|
71
|
+
_qualified_arrow: $ => qualified($, alias(choice($._arrow, $._linear_arrow), $.operator)),
|
|
72
72
|
_qtycon_arrow: $ => parens($, alias($._qualified_arrow, $.qualified)),
|
|
73
73
|
|
|
74
74
|
_tycon: $ => choice($._tyconid, $._pvarsym, alias($._tycon_arrow, $.prefix_id), $._pconsym),
|
package/grammar/type.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-haskell",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Haskell grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@willbooster/oxfmt-config": "1.2.2",
|
|
49
49
|
"@willbooster/oxlint-config": "1.4.8",
|
|
50
50
|
"@willbooster/wb": "22.26.1",
|
|
51
|
-
"@willbooster/web-tree-sitter": "
|
|
51
|
+
"@willbooster/web-tree-sitter": "4.0.2",
|
|
52
52
|
"conventional-changelog-conventionalcommits": "10.4.0",
|
|
53
53
|
"lefthook": "2.2.1",
|
|
54
54
|
"oxfmt": "0.72.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"wrangler": "4.147.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@willbooster/web-tree-sitter": "^
|
|
64
|
+
"@willbooster/web-tree-sitter": "^4.0.2"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
67
67
|
"@willbooster/web-tree-sitter": {
|
package/tree-sitter-haskell.wasm
CHANGED
|
Binary file
|