@willbooster/tree-sitter-javascript 1.0.31 → 2.0.1
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 +34 -13
- 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,9 @@ 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,
|
|
109
|
+
$._regex_flags_start,
|
|
107
110
|
],
|
|
108
111
|
|
|
109
112
|
extras: ($) => [$.comment, $.html_comment, /[\s\p{Zs}\uFEFF\u2028\u2029\u2060\u200B]/u],
|
|
@@ -222,7 +225,10 @@ module.exports = grammar({
|
|
|
222
225
|
'export',
|
|
223
226
|
choice(
|
|
224
227
|
field('declaration', $.declaration),
|
|
225
|
-
seq(
|
|
228
|
+
seq(
|
|
229
|
+
alias($._export_default, 'default'),
|
|
230
|
+
choice(field('declaration', $.declaration), seq(field('value', $.expression), $._semicolon))
|
|
231
|
+
)
|
|
226
232
|
)
|
|
227
233
|
)
|
|
228
234
|
),
|
|
@@ -742,9 +748,15 @@ module.exports = grammar({
|
|
|
742
748
|
prec(
|
|
743
749
|
'declaration',
|
|
744
750
|
seq(
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
751
|
+
choice(
|
|
752
|
+
seq(
|
|
753
|
+
$._default_declaration_start,
|
|
754
|
+
repeat(field('decorator', $.decorator)),
|
|
755
|
+
'class',
|
|
756
|
+
field('name', optional($.identifier))
|
|
757
|
+
),
|
|
758
|
+
seq(repeat(field('decorator', $.decorator)), 'class', field('name', $.identifier))
|
|
759
|
+
),
|
|
748
760
|
optional($.class_heritage),
|
|
749
761
|
field('body', $.class_body)
|
|
750
762
|
)
|
|
@@ -768,9 +780,10 @@ module.exports = grammar({
|
|
|
768
780
|
prec.right(
|
|
769
781
|
'declaration',
|
|
770
782
|
seq(
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
783
|
+
choice(
|
|
784
|
+
seq($._default_declaration_start, optional('async'), 'function', field('name', optional($.identifier))),
|
|
785
|
+
seq(optional('async'), 'function', field('name', $.identifier))
|
|
786
|
+
),
|
|
774
787
|
$._call_signature,
|
|
775
788
|
field('body', $.statement_block)
|
|
776
789
|
)
|
|
@@ -793,10 +806,16 @@ module.exports = grammar({
|
|
|
793
806
|
prec.right(
|
|
794
807
|
'declaration',
|
|
795
808
|
seq(
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
809
|
+
choice(
|
|
810
|
+
seq(
|
|
811
|
+
$._default_declaration_start,
|
|
812
|
+
optional('async'),
|
|
813
|
+
'function',
|
|
814
|
+
'*',
|
|
815
|
+
field('name', optional($.identifier))
|
|
816
|
+
),
|
|
817
|
+
seq(optional('async'), 'function', '*', field('name', $.identifier))
|
|
818
|
+
),
|
|
800
819
|
$._call_signature,
|
|
801
820
|
field('body', $.statement_block)
|
|
802
821
|
)
|
|
@@ -1060,8 +1079,10 @@ module.exports = grammar({
|
|
|
1060
1079
|
seq(
|
|
1061
1080
|
'/',
|
|
1062
1081
|
field('pattern', $.regex_pattern),
|
|
1063
|
-
|
|
1064
|
-
|
|
1082
|
+
choice(
|
|
1083
|
+
seq($._regex_flags_start, token.immediate(prec(1, '/')), field('flags', $.regex_flags)),
|
|
1084
|
+
token.immediate(prec(1, '/'))
|
|
1085
|
+
)
|
|
1065
1086
|
),
|
|
1066
1087
|
|
|
1067
1088
|
regex_pattern: () =>
|
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
|