@willbooster/tree-sitter-haskell 1.0.0 → 1.0.2

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
@@ -12,7 +12,7 @@ Haskell grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), f
12
12
  [tree-sitter/tree-sitter-haskell](https://github.com/tree-sitter/tree-sitter-haskell). We are grateful
13
13
  to its authors and contributors. This is not an official release of that project.
14
14
 
15
- This fork keeps the grammar of upstream's version 0.23.1 and generates the parser with the
15
+ This fork is based on upstream's version 0.23.1 grammar and generates the parser with the
16
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
17
  or later; upstream's runtime rejects it.
18
18
  [Upstream's README at that version](https://github.com/tree-sitter/tree-sitter-haskell/blob/v0.23.1/README.md) lists
@@ -21,19 +21,16 @@ readme that the comments in `grammar.js` refer to.
21
21
 
22
22
  ## Differences from upstream
23
23
 
24
- `grammar.js`, the files in `grammar/`, the external scanner (`src/scanner.c`, `src/unicode.h`), `queries/`, and
25
- upstream's corpus are those of upstream's 0.23.1, except for:
24
+ The fork's main differences from upstream 0.23.1 are:
26
25
 
27
- - **The newline token** (`grammar.js`, `grammar/externals.js`): the entry `/\n/` of `extras` and of `externals` is
28
- written `token(prec(0, /\n/))` in both places, with a comment line above the one in `grammar.js` that points here. The WillBooster/tree-sitter generator turns an unnamed pattern in
29
- `extras` into a lexer separator, which leaves the external token of the same pattern without a symbol, and the
30
- generator then fails. Precedence 0 is the default, so the token lexes as before, and the generated parser has the
31
- same symbols as upstream's. A later upstream version of these files needs the same two lines until the generator
32
- keeps such a pattern as a token ([WillBooster/tree-sitter#129](https://github.com/WillBooster/tree-sitter/issues/129)).
26
+ - **Comment scanning**: an ordinary line comment does not absorb a following marked Haddock comment.
27
+ Unmarked continuation lines beginning in the first column remain in their existing comment block.
28
+ Indented continuation lines are separate comment nodes.
33
29
  - **`queries/highlights.scm`**: three patterns that match fields of the supertype `decl` are written through its
34
30
  subtypes (`decl/function`, `decl/bind`, `decl/signature`), as upstream's repository has them since
35
31
  `tree-sitter/tree-sitter-haskell@0b2ebf7`. A parser of ABI 15 or later carries the supertypes, and the runtime then
36
32
  rejects the 0.23.1 patterns as impossible; upstream's own CLI 0.27.0 does so as well.
33
+ - **`test/corpus/varsym.txt`**: the expected recovery tree for the invalid `f = a | a` input matches this generator; the input still reports an error.
37
34
  - **`test/corpus/null-characters.txt`** is added, because the fuzz job checks that every NUL character of the corpus
38
35
  reaches the fuzz seeds and upstream's corpus has none.
39
36
 
@@ -170,7 +170,7 @@ module.exports = {
170
170
 
171
171
  // The newline is used as a dummy symbol that is emitted whenever the scanner has to update its state even though
172
172
  // the current position must be parsed by the grammar.
173
- token(prec(0, /\n/)),
173
+ /\n/,
174
174
 
175
175
  ],
176
176
 
package/grammar.js CHANGED
@@ -56,8 +56,7 @@ module.exports = grammar({
56
56
  */
57
57
  extras: $ => [
58
58
  /\p{Zs}/,
59
- // Not upstream's bare `/\n/` here and in grammar/externals.js: see "Differences from upstream" in README.md.
60
- token(prec(0, /\n/)),
59
+ /\n/,
61
60
  /\r/,
62
61
  $.cpp,
63
62
  $.comment,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-haskell",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
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.24.0",
51
- "@willbooster/web-tree-sitter": "2.0.1",
51
+ "@willbooster/web-tree-sitter": "2.0.2",
52
52
  "conventional-changelog-conventionalcommits": "10.4.0",
53
53
  "lefthook": "2.1.16",
54
54
  "oxfmt": "0.71.0",
Binary file
package/tree-sitter.json CHANGED
@@ -15,7 +15,7 @@
15
15
  }
16
16
  ],
17
17
  "metadata": {
18
- "version": "1.0.0",
18
+ "version": "1.0.2",
19
19
  "license": "MIT",
20
20
  "description": "Haskell grammar for tree-sitter",
21
21
  "authors": [