@willbooster/tree-sitter-haskell 12.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
@@ -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.
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": "12.0.0",
3
+ "version": "12.1.0",
4
4
  "description": "Haskell grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -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": "12.0.0",
38
+ "version": "12.1.0",
39
39
  "license": "MIT",
40
40
  "description": "Haskell grammar for tree-sitter",
41
41
  "authors": [