@willbooster/tree-sitter-javascript 1.0.12 → 1.0.14

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 CHANGED
@@ -81,6 +81,7 @@ module.exports = grammar({
81
81
  $._line_break_after_binding,
82
82
  $._line_break_after_field,
83
83
  $._line_break_after_modifier,
84
+ $._line_break_before_attributes,
84
85
  ],
85
86
 
86
87
  extras: ($) => [$.comment, $.html_comment, /[\s\p{Zs}\uFEFF\u2028\u2029\u2060\u200B]/u],
@@ -179,9 +180,11 @@ module.exports = grammar({
179
180
  seq(
180
181
  'export',
181
182
  choice(
182
- seq('*', $._from_clause),
183
- seq($.namespace_export, $._from_clause),
184
- seq($.export_clause, $._from_clause),
183
+ seq(
184
+ choice('*', $.namespace_export, $.export_clause),
185
+ $._from_clause,
186
+ optional(choice($.import_attribute, $._line_break_before_attributes))
187
+ ),
185
188
  alias($._local_export_clause, $.export_clause)
186
189
  ),
187
190
  $._semicolon
@@ -240,7 +243,7 @@ module.exports = grammar({
240
243
  seq(
241
244
  'import',
242
245
  choice(seq($.import_clause, $._from_clause), field('source', $.string)),
243
- optional($.import_attribute),
246
+ optional(choice($.import_attribute, $._line_break_before_attributes)),
244
247
  $._semicolon
245
248
  ),
246
249
 
@@ -1109,7 +1112,8 @@ module.exports = grammar({
1109
1112
  choice(
1110
1113
  $.identifier,
1111
1114
  alias($.decorator_member_expression, $.member_expression),
1112
- alias($.decorator_call_expression, $.call_expression)
1115
+ alias($.decorator_call_expression, $.call_expression),
1116
+ $.parenthesized_expression
1113
1117
  )
1114
1118
  ),
1115
1119
 
@@ -1119,7 +1123,10 @@ module.exports = grammar({
1119
1123
  seq(
1120
1124
  field('object', choice($.identifier, alias($.decorator_member_expression, $.member_expression))),
1121
1125
  '.',
1122
- field('property', alias($.identifier, $.property_identifier))
1126
+ field(
1127
+ 'property',
1128
+ choice(reserved('properties', alias($.identifier, $.property_identifier)), $.private_property_identifier)
1129
+ )
1123
1130
  )
1124
1131
  ),
1125
1132
 
@@ -1127,7 +1134,10 @@ module.exports = grammar({
1127
1134
  prec(
1128
1135
  'call',
1129
1136
  seq(
1130
- field('function', choice($.identifier, alias($.decorator_member_expression, $.member_expression))),
1137
+ field(
1138
+ 'function',
1139
+ choice($.identifier, alias($.decorator_member_expression, $.member_expression), $.parenthesized_expression)
1140
+ ),
1131
1141
  field('arguments', $.arguments)
1132
1142
  )
1133
1143
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-javascript",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "JavaScript grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -1021,6 +1021,10 @@
1021
1021
  {
1022
1022
  "type": "member_expression",
1023
1023
  "named": true
1024
+ },
1025
+ {
1026
+ "type": "parenthesized_expression",
1027
+ "named": true
1024
1028
  }
1025
1029
  ]
1026
1030
  }
@@ -1166,13 +1170,17 @@
1166
1170
  }
1167
1171
  },
1168
1172
  "children": {
1169
- "multiple": false,
1173
+ "multiple": true,
1170
1174
  "required": false,
1171
1175
  "types": [
1172
1176
  {
1173
1177
  "type": "export_clause",
1174
1178
  "named": true
1175
1179
  },
1180
+ {
1181
+ "type": "import_attribute",
1182
+ "named": true
1183
+ },
1176
1184
  {
1177
1185
  "type": "namespace_export",
1178
1186
  "named": true
Binary file
package/tree-sitter.json CHANGED
@@ -16,7 +16,7 @@
16
16
  }
17
17
  ],
18
18
  "metadata": {
19
- "version": "1.0.12",
19
+ "version": "1.0.14",
20
20
  "license": "MIT",
21
21
  "description": "JavaScript grammar for tree-sitter",
22
22
  "authors": [