@willbooster/tree-sitter-typescript 1.3.4 → 1.3.5

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.
@@ -146,6 +146,7 @@ module.exports = function defineGrammar(dialect) {
146
146
  ],
147
147
 
148
148
  conflicts: ($, previous) => [
149
+ [$.import_specifier, $._module_export_name],
149
150
  [$.export_specifier, $._local_export_specifier, $._module_export_name],
150
151
  [$.export_specifier, $._module_export_name],
151
152
  [$.export_specifier, $._local_export_specifier],
@@ -513,14 +514,14 @@ module.exports = function defineGrammar(dialect) {
513
514
 
514
515
  _import_identifier: ($) => choice($.identifier, alias('type', $.identifier)),
515
516
 
516
- import_specifier: ($) =>
517
- seq(
518
- optional(choice('type', 'typeof')),
519
- choice(
520
- field('name', $._import_identifier),
521
- seq(field('name', $._module_export_name), 'as', field('alias', $._import_identifier))
522
- )
523
- ),
517
+ import_specifier: ($) => {
518
+ const name = choice($._import_identifier, alias('as', $.identifier));
519
+ const specifier = choice(
520
+ field('name', name),
521
+ seq(field('name', choice($._module_export_name, alias('as', $.identifier))), 'as', field('alias', name))
522
+ );
523
+ return choice(specifier, prec.dynamic(1, seq('type', specifier)));
524
+ },
524
525
 
525
526
  import_attribute: ($) => seq(choice('with', 'assert'), $.object),
526
527
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-typescript",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
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.4",
86
+ "version": "1.3.5",
87
87
  "license": "MIT",
88
88
  "description": "TypeScript and TSX grammars for tree-sitter",
89
89
  "authors": [