@willbooster/tree-sitter-javascript 1.0.13 → 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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-javascript",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "JavaScript grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -1170,13 +1170,17 @@
1170
1170
  }
1171
1171
  },
1172
1172
  "children": {
1173
- "multiple": false,
1173
+ "multiple": true,
1174
1174
  "required": false,
1175
1175
  "types": [
1176
1176
  {
1177
1177
  "type": "export_clause",
1178
1178
  "named": true
1179
1179
  },
1180
+ {
1181
+ "type": "import_attribute",
1182
+ "named": true
1183
+ },
1180
1184
  {
1181
1185
  "type": "namespace_export",
1182
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.13",
19
+ "version": "1.0.14",
20
20
  "license": "MIT",
21
21
  "description": "JavaScript grammar for tree-sitter",
22
22
  "authors": [