@willbooster/tree-sitter-haskell 11.0.0 → 12.1.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,7 +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. This package supports the fork's runtime version 10.0.1 or later in the 10.x series; 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. This package supports the fork's runtime version 10.0.2 or later within 10.x in the 10.x series; upstream's runtime rejects it.
17
17
  [Upstream's README at that version](https://github.com/tree-sitter/tree-sitter-haskell/blob/v0.23.1/README.md) lists
18
18
  the supported language extensions. The fork's node and query contracts are described below.
19
19
 
@@ -22,6 +22,7 @@ the supported language extensions. The fork's node and query contracts are descr
22
22
  The fork's main differences from upstream 0.23.1 are:
23
23
 
24
24
  - **Whitespace**: horizontal tabs separate tokens, are accepted before Haddock markers, and advance layout to the next eight-column tab stop.
25
+ - **OrPatterns**: parenthesized alternatives separated by semicolons, such as `(A; B)`, parse as an `or_pattern` node with an `alternative` field for each pattern.
25
26
  - **MultilineStrings**: triple-quoted literals retain their complete source as a single `string` node, including embedded quotes, escapes, and string gaps.
26
27
  - **Comment scanning**: comments and Haddock nodes expose a named `content` child, preserving body whitespace and excluding outer delimiters. Ordinary comment injection captures this child.
27
28
  Empty block comments such as `{--}` terminate at their closing delimiter and preserve following code.
@@ -39,7 +40,7 @@ reports an error: the lexers of the WillBooster/tree-sitter generator let charac
39
40
  ## Usage
40
41
 
41
42
  The npm package ships `tree-sitter-haskell.wasm` for
42
- [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 10.0.1 or later in the 10.x series, which runs in Node.js, Bun, browsers, and Cloudflare Workers. In Node.js and Bun, load the grammar from its path:
43
+ [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 10.0.2 or later within 10.x in the 10.x series, which runs in Node.js, Bun, browsers, and Cloudflare Workers. In Node.js and Bun, load the grammar from its path:
43
44
 
44
45
  ```js
45
46
  import { fileURLToPath } from 'node:url';
@@ -101,8 +102,8 @@ fuzzed with:
101
102
 
102
103
  ```toml
103
104
  [dependencies]
104
- tree-sitter = { package = "willbooster-tree-sitter", version = "10.0.1" }
105
- tree-sitter-haskell = { package = "willbooster-tree-sitter-haskell", version = "11" }
105
+ tree-sitter = { package = "willbooster-tree-sitter", version = "10.0.2" }
106
+ tree-sitter-haskell = { package = "willbooster-tree-sitter-haskell", version = "12" }
106
107
  ```
107
108
 
108
109
  ```rust
package/grammar/pat.js CHANGED
@@ -23,6 +23,8 @@ const patternRules = (name, recordField) => {
23
23
 
24
24
  [name('_pat_tuple')]: $ => parens($, rule($, '_pat_tuple_elems')),
25
25
 
26
+ [name('_pat_or')]: $ => parens($, sep2(';', field('alternative', rule($, '_pat_texp')))),
27
+
26
28
  [name('_pat_unboxed_tuple')]: $ => unboxed_tuple_full($, rule($, '_pat_texp')),
27
29
 
28
30
  [name('_pat_unboxed_sum')]: $ => unboxed_sum_single($, rule($, '_pat_texp')),
@@ -120,6 +122,7 @@ const patternRules = (name, recordField) => {
120
122
  alias(rule($, '_pat_wildcard'), $.wildcard),
121
123
  alias(rule($, '_pat_parens'), $.parens),
122
124
  alias(rule($, '_pat_tuple'), $.tuple),
125
+ alias(rule($, '_pat_or'), $.or_pattern),
123
126
  alias(rule($, '_pat_unboxed_tuple'), $.unboxed_tuple),
124
127
  alias(rule($, '_pat_unboxed_sum'), $.unboxed_sum),
125
128
  alias(rule($, '_pat_list'), $.list),
@@ -45,6 +45,10 @@
45
45
  "type": "negation",
46
46
  "named": true
47
47
  },
48
+ {
49
+ "type": "or_pattern",
50
+ "named": true
51
+ },
48
52
  {
49
53
  "type": "parens",
50
54
  "named": true
@@ -603,6 +607,10 @@
603
607
  "type": "negation",
604
608
  "named": true
605
609
  },
610
+ {
611
+ "type": "or_pattern",
612
+ "named": true
613
+ },
606
614
  {
607
615
  "type": "parens",
608
616
  "named": true
@@ -4874,6 +4882,38 @@
4874
4882
  }
4875
4883
  }
4876
4884
  },
4885
+ {
4886
+ "type": "or_pattern",
4887
+ "named": true,
4888
+ "fields": {
4889
+ "alternative": {
4890
+ "multiple": true,
4891
+ "required": true,
4892
+ "types": [
4893
+ {
4894
+ "type": "binding_pattern_operand",
4895
+ "named": true
4896
+ },
4897
+ {
4898
+ "type": "infix_chain",
4899
+ "named": true
4900
+ },
4901
+ {
4902
+ "type": "pattern_operand",
4903
+ "named": true
4904
+ },
4905
+ {
4906
+ "type": "signature",
4907
+ "named": true
4908
+ },
4909
+ {
4910
+ "type": "view_pattern",
4911
+ "named": true
4912
+ }
4913
+ ]
4914
+ }
4915
+ }
4916
+ },
4877
4917
  {
4878
4918
  "type": "parens",
4879
4919
  "named": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-haskell",
3
- "version": "11.0.0",
3
+ "version": "12.1.0",
4
4
  "description": "Haskell grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -51,7 +51,7 @@
51
51
  "@willbooster/oxfmt-config": "1.2.2",
52
52
  "@willbooster/oxlint-config": "1.4.8",
53
53
  "@willbooster/wb": "22.26.2",
54
- "@willbooster/web-tree-sitter": "10.0.1",
54
+ "@willbooster/web-tree-sitter": "10.0.2",
55
55
  "conventional-changelog-conventionalcommits": "10.4.0",
56
56
  "lefthook": "2.2.2",
57
57
  "oxfmt": "0.73.0",
@@ -64,7 +64,7 @@
64
64
  "wrangler": "4.147.0"
65
65
  },
66
66
  "peerDependencies": {
67
- "@willbooster/web-tree-sitter": "^10.0.1"
67
+ "@willbooster/web-tree-sitter": "^10.0.2"
68
68
  },
69
69
  "peerDependenciesMeta": {
70
70
  "@willbooster/web-tree-sitter": {
@@ -41,6 +41,10 @@
41
41
  "type": "negation",
42
42
  "named": true
43
43
  },
44
+ {
45
+ "type": "or_pattern",
46
+ "named": true
47
+ },
44
48
  {
45
49
  "type": "parens",
46
50
  "named": true
@@ -587,6 +591,10 @@
587
591
  "type": "negation",
588
592
  "named": true
589
593
  },
594
+ {
595
+ "type": "or_pattern",
596
+ "named": true
597
+ },
590
598
  {
591
599
  "type": "parens",
592
600
  "named": true
@@ -4711,6 +4719,38 @@
4711
4719
  }
4712
4720
  }
4713
4721
  },
4722
+ {
4723
+ "type": "or_pattern",
4724
+ "named": true,
4725
+ "fields": {
4726
+ "alternative": {
4727
+ "multiple": true,
4728
+ "required": true,
4729
+ "types": [
4730
+ {
4731
+ "type": "binding_pattern_operand",
4732
+ "named": true
4733
+ },
4734
+ {
4735
+ "type": "infix_chain",
4736
+ "named": true
4737
+ },
4738
+ {
4739
+ "type": "pattern_operand",
4740
+ "named": true
4741
+ },
4742
+ {
4743
+ "type": "signature",
4744
+ "named": true
4745
+ },
4746
+ {
4747
+ "type": "view_pattern",
4748
+ "named": true
4749
+ }
4750
+ ]
4751
+ }
4752
+ }
4753
+ },
4714
4754
  {
4715
4755
  "type": "parens",
4716
4756
  "named": true,
Binary file
Binary file
package/tree-sitter.json CHANGED
@@ -35,7 +35,7 @@
35
35
  }
36
36
  ],
37
37
  "metadata": {
38
- "version": "11.0.0",
38
+ "version": "12.1.0",
39
39
  "license": "MIT",
40
40
  "description": "Haskell grammar for tree-sitter",
41
41
  "authors": [