@willbooster/tree-sitter-go 2.0.0 → 2.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
@@ -12,7 +12,7 @@ Go grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked
12
12
  [tree-sitter/tree-sitter-go](https://github.com/tree-sitter/tree-sitter-go). 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.25.0 and generates the parser with the
15
+ This fork extends upstream's version 0.25.0 grammar with method type parameters 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
17
17
  number (`0x57420001`), so it loads only with the WillBooster runtime, version 2.0.0 or later
18
18
  (`willbooster-tree-sitter`, `@willbooster/web-tree-sitter`), and not with upstream's tree-sitter.
package/grammar.js CHANGED
@@ -90,6 +90,7 @@ module.exports = grammar({
90
90
  [$.qualified_type, $._expression],
91
91
  [$.generic_type, $._simple_type],
92
92
  [$.parameter_declaration, $._simple_type],
93
+ [$.type_parameter_declaration, $._simple_type],
93
94
  [$.type_parameter_declaration, $._simple_type, $._expression],
94
95
  [$.type_parameter_declaration, $._expression],
95
96
  [$.type_parameter_declaration, $._simple_type, $.generic_type, $._expression],
@@ -231,6 +232,7 @@ module.exports = grammar({
231
232
  'func',
232
233
  field('receiver', $.parameter_list),
233
234
  field('name', $._field_identifier),
235
+ field('type_parameters', optional($.type_parameter_list)),
234
236
  field('parameters', $.parameter_list),
235
237
  field('result', optional(choice($.parameter_list, $._simple_type))),
236
238
  field('body', optional($.block)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-go",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Go grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -1633,6 +1633,16 @@
1633
1633
  "named": true
1634
1634
  }
1635
1635
  ]
1636
+ },
1637
+ "type_parameters": {
1638
+ "multiple": false,
1639
+ "required": false,
1640
+ "types": [
1641
+ {
1642
+ "type": "type_parameter_list",
1643
+ "named": true
1644
+ }
1645
+ ]
1636
1646
  }
1637
1647
  }
1638
1648
  },
Binary file
package/tree-sitter.json CHANGED
@@ -14,7 +14,7 @@
14
14
  }
15
15
  ],
16
16
  "metadata": {
17
- "version": "2.0.0",
17
+ "version": "2.1.0",
18
18
  "license": "MIT",
19
19
  "description": "Go grammar for tree-sitter",
20
20
  "authors": [