@willbooster/tree-sitter-javascript 1.0.31 → 2.0.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/grammar.js +29 -11
- package/package.json +1 -1
- package/src/node-types.json +3 -3
- package/tree-sitter-javascript.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -104,6 +104,8 @@ module.exports = grammar({
|
|
|
104
104
|
$._resource_binding_start,
|
|
105
105
|
$._resource_binding_continuation,
|
|
106
106
|
$._plain_resource_for_of_context,
|
|
107
|
+
$._export_default,
|
|
108
|
+
$._default_declaration_start,
|
|
107
109
|
],
|
|
108
110
|
|
|
109
111
|
extras: ($) => [$.comment, $.html_comment, /[\s\p{Zs}\uFEFF\u2028\u2029\u2060\u200B]/u],
|
|
@@ -222,7 +224,10 @@ module.exports = grammar({
|
|
|
222
224
|
'export',
|
|
223
225
|
choice(
|
|
224
226
|
field('declaration', $.declaration),
|
|
225
|
-
seq(
|
|
227
|
+
seq(
|
|
228
|
+
alias($._export_default, 'default'),
|
|
229
|
+
choice(field('declaration', $.declaration), seq(field('value', $.expression), $._semicolon))
|
|
230
|
+
)
|
|
226
231
|
)
|
|
227
232
|
)
|
|
228
233
|
),
|
|
@@ -742,9 +747,15 @@ module.exports = grammar({
|
|
|
742
747
|
prec(
|
|
743
748
|
'declaration',
|
|
744
749
|
seq(
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
750
|
+
choice(
|
|
751
|
+
seq(
|
|
752
|
+
$._default_declaration_start,
|
|
753
|
+
repeat(field('decorator', $.decorator)),
|
|
754
|
+
'class',
|
|
755
|
+
field('name', optional($.identifier))
|
|
756
|
+
),
|
|
757
|
+
seq(repeat(field('decorator', $.decorator)), 'class', field('name', $.identifier))
|
|
758
|
+
),
|
|
748
759
|
optional($.class_heritage),
|
|
749
760
|
field('body', $.class_body)
|
|
750
761
|
)
|
|
@@ -768,9 +779,10 @@ module.exports = grammar({
|
|
|
768
779
|
prec.right(
|
|
769
780
|
'declaration',
|
|
770
781
|
seq(
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
782
|
+
choice(
|
|
783
|
+
seq($._default_declaration_start, optional('async'), 'function', field('name', optional($.identifier))),
|
|
784
|
+
seq(optional('async'), 'function', field('name', $.identifier))
|
|
785
|
+
),
|
|
774
786
|
$._call_signature,
|
|
775
787
|
field('body', $.statement_block)
|
|
776
788
|
)
|
|
@@ -793,10 +805,16 @@ module.exports = grammar({
|
|
|
793
805
|
prec.right(
|
|
794
806
|
'declaration',
|
|
795
807
|
seq(
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
808
|
+
choice(
|
|
809
|
+
seq(
|
|
810
|
+
$._default_declaration_start,
|
|
811
|
+
optional('async'),
|
|
812
|
+
'function',
|
|
813
|
+
'*',
|
|
814
|
+
field('name', optional($.identifier))
|
|
815
|
+
),
|
|
816
|
+
seq(optional('async'), 'function', '*', field('name', $.identifier))
|
|
817
|
+
),
|
|
800
818
|
$._call_signature,
|
|
801
819
|
field('body', $.statement_block)
|
|
802
820
|
)
|
package/package.json
CHANGED
package/src/node-types.json
CHANGED
|
@@ -923,7 +923,7 @@
|
|
|
923
923
|
},
|
|
924
924
|
"name": {
|
|
925
925
|
"multiple": false,
|
|
926
|
-
"required":
|
|
926
|
+
"required": false,
|
|
927
927
|
"types": [
|
|
928
928
|
{
|
|
929
929
|
"type": "identifier",
|
|
@@ -1514,7 +1514,7 @@
|
|
|
1514
1514
|
},
|
|
1515
1515
|
"name": {
|
|
1516
1516
|
"multiple": false,
|
|
1517
|
-
"required":
|
|
1517
|
+
"required": false,
|
|
1518
1518
|
"types": [
|
|
1519
1519
|
{
|
|
1520
1520
|
"type": "identifier",
|
|
@@ -1622,7 +1622,7 @@
|
|
|
1622
1622
|
},
|
|
1623
1623
|
"name": {
|
|
1624
1624
|
"multiple": false,
|
|
1625
|
-
"required":
|
|
1625
|
+
"required": false,
|
|
1626
1626
|
"types": [
|
|
1627
1627
|
{
|
|
1628
1628
|
"type": "identifier",
|
|
Binary file
|