@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 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 2.0.0
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 2.0.0 or later, which runs in Node.js, Bun, browsers, and Cloudflare Workers. In Node.js and Bun, load the grammar from its path:
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 = "2.0.0" }
93
- tree-sitter-haskell = { package = "willbooster-tree-sitter-haskell", version = "1" }
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. It skips the eleven cases that
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;
@@ -91,6 +91,7 @@ module.exports = {
91
91
  $._phantom_where,
92
92
  $._phantom_in,
93
93
  $._phantom_arrow,
94
+ $._phantom_linear_arrow,
94
95
  $._phantom_bar,
95
96
  $._phantom_deriving,
96
97
 
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
@@ -197,7 +197,7 @@ module.exports = {
197
197
  $._fun_arrow,
198
198
  ),
199
199
  seq(
200
- optional($._phantom_arrow),
200
+ optional($._phantom_linear_arrow),
201
201
  field('arrow', $._linear_arrow),
202
202
  ),
203
203
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-haskell",
3
- "version": "2.1.0",
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": "2.0.2",
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": "^2.0.0"
64
+ "@willbooster/web-tree-sitter": "^4.0.2"
65
65
  },
66
66
  "peerDependenciesMeta": {
67
67
  "@willbooster/web-tree-sitter": {
Binary file
package/tree-sitter.json CHANGED
@@ -15,7 +15,7 @@
15
15
  }
16
16
  ],
17
17
  "metadata": {
18
- "version": "2.1.0",
18
+ "version": "3.0.0",
19
19
  "license": "MIT",
20
20
  "description": "Haskell grammar for tree-sitter",
21
21
  "authors": [