@willbooster/tree-sitter-typescript 1.3.2 → 1.3.3

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.
@@ -145,6 +145,9 @@ module.exports = function defineGrammar(dialect) {
145
145
  ],
146
146
 
147
147
  conflicts: ($, previous) => [
148
+ [$.export_specifier, $._local_export_specifier, $._module_export_name],
149
+ [$.export_specifier, $._module_export_name],
150
+ [$.export_specifier, $._local_export_specifier],
148
151
  ...withTypeArgumentsTarget($, previous),
149
152
  [$._type_arguments_target, $.using_declaration],
150
153
  [$._type_arguments_target, $._for_header, $._for_using_declaration],
@@ -475,9 +478,21 @@ module.exports = function defineGrammar(dialect) {
475
478
  // tsx only. See jsx_opening_element.
476
479
  jsx_self_closing_element: ($) => prec.dynamic(-1, seq($._jsx_start_opening_element, '/>')),
477
480
 
478
- export_specifier: (_, previous) => seq(optional(choice('type', 'typeof')), previous),
481
+ export_specifier: ($) => {
482
+ const name = choice($._module_export_name, alias('as', $.identifier));
483
+ const specifier = seq(field('name', name), optional(seq('as', field('alias', name))));
484
+ return choice(specifier, prec.dynamic(1, seq(choice('type', 'typeof'), specifier)));
485
+ },
486
+
487
+ _module_export_name: ($, previous) => choice(previous, alias('type', $.identifier)),
479
488
 
480
- _local_export_specifier: (_, previous) => seq(optional(choice('type', 'typeof')), previous),
489
+ _local_export_specifier: ($) => {
490
+ const specifier = seq(
491
+ field('name', choice($.identifier, alias('type', $.identifier), alias('as', $.identifier), $.string)),
492
+ optional(seq('as', field('alias', choice($._module_export_name, alias('as', $.identifier)))))
493
+ );
494
+ return choice(specifier, prec.dynamic(1, seq(choice('type', 'typeof'), specifier)));
495
+ },
481
496
 
482
497
  _import_identifier: ($) => choice($.identifier, alias('type', $.identifier)),
483
498
 
@@ -486,11 +501,7 @@ module.exports = function defineGrammar(dialect) {
486
501
  optional(choice('type', 'typeof')),
487
502
  choice(
488
503
  field('name', $._import_identifier),
489
- seq(
490
- field('name', choice($._module_export_name, alias('type', $.identifier))),
491
- 'as',
492
- field('alias', $._import_identifier)
493
- )
504
+ seq(field('name', $._module_export_name), 'as', field('alias', $._import_identifier))
494
505
  )
495
506
  ),
496
507
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-typescript",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "TypeScript and TSX grammars for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
Binary file
Binary file
package/tree-sitter.json CHANGED
@@ -83,7 +83,7 @@
83
83
  }
84
84
  ],
85
85
  "metadata": {
86
- "version": "1.3.2",
86
+ "version": "1.3.3",
87
87
  "license": "MIT",
88
88
  "description": "TypeScript and TSX grammars for tree-sitter",
89
89
  "authors": [