@willbooster/tree-sitter-haskell 13.0.0 → 13.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 +1 -0
- package/grammar/decl.js +1 -1
- package/grammar/module.js +3 -1
- package/hsc/src/node-types.json +38 -0
- package/package.json +1 -1
- package/queries/highlights.scm +1 -0
- package/src/node-types.json +38 -0
- package/tree-sitter-haskell.wasm +0 -0
- package/tree-sitter-hsc.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -23,6 +23,7 @@ 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
25
|
- **ExplicitNamespaces**: import and export items, including subordinate items, accept the `data` namespace, and fixity declarations accept `type` and `data`. A namespaced subordinate item such as `type (#)` or `data P` is a `namespaced_child` node with a `namespace` child; a `data` item puts a constructor name in a `constructor` field and a variable or operator in the `variable` or `operator` field.
|
|
26
|
+
- **NamedDefaults**: `default` declarations accept a class name before the type list, such as `default Monoid ([Int])`, in a `class` field, and export lists accept `default` items such as `default Monoid` as `default_export` nodes.
|
|
26
27
|
- **OrPatterns**: parenthesized alternatives separated by semicolons, such as `(A; B)`, parse as an `or_pattern` node with an `alternative` field for each pattern.
|
|
27
28
|
- **MultilineStrings**: triple-quoted literals retain their complete source as a single `string` node, including embedded quotes, escapes, and string gaps.
|
|
28
29
|
- **Comment scanning**: comments and Haddock nodes expose a named `content` child, preserving body whitespace and excluding outer delimiters. Ordinary comment injection captures this child.
|
package/grammar/decl.js
CHANGED
|
@@ -187,6 +187,6 @@ module.exports = {
|
|
|
187
187
|
field('signature', $._foreign_signature),
|
|
188
188
|
),
|
|
189
189
|
|
|
190
|
-
default_types: $ => seq('default', parens($, optional(sep1(',', field('type', $._ktype))))),
|
|
190
|
+
default_types: $ => seq('default', optional(field('class', $._tyconids)), parens($, optional(sep1(',', field('type', $._ktype))))),
|
|
191
191
|
|
|
192
192
|
}
|
package/grammar/module.js
CHANGED
|
@@ -111,9 +111,11 @@ module.exports = {
|
|
|
111
111
|
|
|
112
112
|
module_export: $ => seq('module', field('module', $.module)),
|
|
113
113
|
|
|
114
|
+
default_export: $ => seq('default', field('class', $._tyconids)),
|
|
115
|
+
|
|
114
116
|
exports: $ => parens(
|
|
115
117
|
$,
|
|
116
|
-
optional(sep1(',', choice(field('export', alias($._ie_entity, $.export)), $.module_export))),
|
|
118
|
+
optional(sep1(',', choice(field('export', alias($._ie_entity, $.export)), $.module_export, $.default_export))),
|
|
117
119
|
optional(','),
|
|
118
120
|
),
|
|
119
121
|
|
package/hsc/src/node-types.json
CHANGED
|
@@ -2028,6 +2028,26 @@
|
|
|
2028
2028
|
]
|
|
2029
2029
|
}
|
|
2030
2030
|
},
|
|
2031
|
+
{
|
|
2032
|
+
"type": "default_export",
|
|
2033
|
+
"named": true,
|
|
2034
|
+
"fields": {
|
|
2035
|
+
"class": {
|
|
2036
|
+
"multiple": false,
|
|
2037
|
+
"required": true,
|
|
2038
|
+
"types": [
|
|
2039
|
+
{
|
|
2040
|
+
"type": "name",
|
|
2041
|
+
"named": true
|
|
2042
|
+
},
|
|
2043
|
+
{
|
|
2044
|
+
"type": "qualified",
|
|
2045
|
+
"named": true
|
|
2046
|
+
}
|
|
2047
|
+
]
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
},
|
|
2031
2051
|
{
|
|
2032
2052
|
"type": "default_signature",
|
|
2033
2053
|
"named": true,
|
|
@@ -2048,6 +2068,20 @@
|
|
|
2048
2068
|
"type": "default_types",
|
|
2049
2069
|
"named": true,
|
|
2050
2070
|
"fields": {
|
|
2071
|
+
"class": {
|
|
2072
|
+
"multiple": false,
|
|
2073
|
+
"required": false,
|
|
2074
|
+
"types": [
|
|
2075
|
+
{
|
|
2076
|
+
"type": "name",
|
|
2077
|
+
"named": true
|
|
2078
|
+
},
|
|
2079
|
+
{
|
|
2080
|
+
"type": "qualified",
|
|
2081
|
+
"named": true
|
|
2082
|
+
}
|
|
2083
|
+
]
|
|
2084
|
+
},
|
|
2051
2085
|
"type": {
|
|
2052
2086
|
"multiple": true,
|
|
2053
2087
|
"required": false,
|
|
@@ -2581,6 +2615,10 @@
|
|
|
2581
2615
|
"multiple": true,
|
|
2582
2616
|
"required": false,
|
|
2583
2617
|
"types": [
|
|
2618
|
+
{
|
|
2619
|
+
"type": "default_export",
|
|
2620
|
+
"named": true
|
|
2621
|
+
},
|
|
2584
2622
|
{
|
|
2585
2623
|
"type": "module_export",
|
|
2586
2624
|
"named": true
|
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
package/src/node-types.json
CHANGED
|
@@ -1980,6 +1980,26 @@
|
|
|
1980
1980
|
]
|
|
1981
1981
|
}
|
|
1982
1982
|
},
|
|
1983
|
+
{
|
|
1984
|
+
"type": "default_export",
|
|
1985
|
+
"named": true,
|
|
1986
|
+
"fields": {
|
|
1987
|
+
"class": {
|
|
1988
|
+
"multiple": false,
|
|
1989
|
+
"required": true,
|
|
1990
|
+
"types": [
|
|
1991
|
+
{
|
|
1992
|
+
"type": "name",
|
|
1993
|
+
"named": true
|
|
1994
|
+
},
|
|
1995
|
+
{
|
|
1996
|
+
"type": "qualified",
|
|
1997
|
+
"named": true
|
|
1998
|
+
}
|
|
1999
|
+
]
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
},
|
|
1983
2003
|
{
|
|
1984
2004
|
"type": "default_signature",
|
|
1985
2005
|
"named": true,
|
|
@@ -2000,6 +2020,20 @@
|
|
|
2000
2020
|
"type": "default_types",
|
|
2001
2021
|
"named": true,
|
|
2002
2022
|
"fields": {
|
|
2023
|
+
"class": {
|
|
2024
|
+
"multiple": false,
|
|
2025
|
+
"required": false,
|
|
2026
|
+
"types": [
|
|
2027
|
+
{
|
|
2028
|
+
"type": "name",
|
|
2029
|
+
"named": true
|
|
2030
|
+
},
|
|
2031
|
+
{
|
|
2032
|
+
"type": "qualified",
|
|
2033
|
+
"named": true
|
|
2034
|
+
}
|
|
2035
|
+
]
|
|
2036
|
+
},
|
|
2003
2037
|
"type": {
|
|
2004
2038
|
"multiple": true,
|
|
2005
2039
|
"required": false,
|
|
@@ -2511,6 +2545,10 @@
|
|
|
2511
2545
|
"multiple": true,
|
|
2512
2546
|
"required": false,
|
|
2513
2547
|
"types": [
|
|
2548
|
+
{
|
|
2549
|
+
"type": "default_export",
|
|
2550
|
+
"named": true
|
|
2551
|
+
},
|
|
2514
2552
|
{
|
|
2515
2553
|
"type": "module_export",
|
|
2516
2554
|
"named": true
|
package/tree-sitter-haskell.wasm
CHANGED
|
Binary file
|
package/tree-sitter-hsc.wasm
CHANGED
|
Binary file
|