@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.
- package/common/defineGrammar.js +18 -7
- package/package.json +1 -1
- package/tree-sitter-tsx.wasm +0 -0
- package/tree-sitter-typescript.wasm +0 -0
- package/tree-sitter.json +1 -1
package/common/defineGrammar.js
CHANGED
|
@@ -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: (
|
|
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: (
|
|
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
package/tree-sitter-tsx.wasm
CHANGED
|
Binary file
|
|
Binary file
|