@willbooster/tree-sitter-python 5.0.0 → 5.2.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 +7 -3
- package/package.json +1 -1
- package/src/node-types.json +24 -24
- package/tree-sitter-python.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -572,7 +572,7 @@ module.exports = grammar({
|
|
|
572
572
|
)
|
|
573
573
|
),
|
|
574
574
|
|
|
575
|
-
_as_pattern: ($) => seq($.case_pattern, 'as', $.identifier),
|
|
575
|
+
_as_pattern: ($) => seq($.case_pattern, 'as', field('alias', $.identifier)),
|
|
576
576
|
|
|
577
577
|
union_pattern: ($) => prec.right(seq($._simple_pattern, repeat1(prec.left(seq('|', $._simple_pattern))))),
|
|
578
578
|
|
|
@@ -847,8 +847,12 @@ module.exports = grammar({
|
|
|
847
847
|
prec(
|
|
848
848
|
PREC.typed_parameter,
|
|
849
849
|
choice(
|
|
850
|
-
seq(choice($.identifier, $.dictionary_splat_pattern), ':', field('type', $.type)),
|
|
851
|
-
seq(
|
|
850
|
+
seq(field('name', choice($.identifier, $.dictionary_splat_pattern)), ':', field('type', $.type)),
|
|
851
|
+
seq(
|
|
852
|
+
field('name', $.list_splat_pattern),
|
|
853
|
+
':',
|
|
854
|
+
field('type', choice($.type, alias($._default_splat_type, $.splat_type)))
|
|
855
|
+
)
|
|
852
856
|
)
|
|
853
857
|
),
|
|
854
858
|
|
package/package.json
CHANGED
package/src/node-types.json
CHANGED
|
@@ -270,17 +270,21 @@
|
|
|
270
270
|
"fields": {
|
|
271
271
|
"alias": {
|
|
272
272
|
"multiple": false,
|
|
273
|
-
"required":
|
|
273
|
+
"required": true,
|
|
274
274
|
"types": [
|
|
275
275
|
{
|
|
276
276
|
"type": "as_pattern_target",
|
|
277
277
|
"named": true
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"type": "identifier",
|
|
281
|
+
"named": true
|
|
278
282
|
}
|
|
279
283
|
]
|
|
280
284
|
}
|
|
281
285
|
},
|
|
282
286
|
"children": {
|
|
283
|
-
"multiple":
|
|
287
|
+
"multiple": false,
|
|
284
288
|
"required": true,
|
|
285
289
|
"types": [
|
|
286
290
|
{
|
|
@@ -290,10 +294,6 @@
|
|
|
290
294
|
{
|
|
291
295
|
"type": "expression",
|
|
292
296
|
"named": true
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
"type": "identifier",
|
|
296
|
-
"named": true
|
|
297
297
|
}
|
|
298
298
|
]
|
|
299
299
|
}
|
|
@@ -3361,6 +3361,24 @@
|
|
|
3361
3361
|
"type": "typed_parameter",
|
|
3362
3362
|
"named": true,
|
|
3363
3363
|
"fields": {
|
|
3364
|
+
"name": {
|
|
3365
|
+
"multiple": false,
|
|
3366
|
+
"required": true,
|
|
3367
|
+
"types": [
|
|
3368
|
+
{
|
|
3369
|
+
"type": "dictionary_splat_pattern",
|
|
3370
|
+
"named": true
|
|
3371
|
+
},
|
|
3372
|
+
{
|
|
3373
|
+
"type": "identifier",
|
|
3374
|
+
"named": true
|
|
3375
|
+
},
|
|
3376
|
+
{
|
|
3377
|
+
"type": "list_splat_pattern",
|
|
3378
|
+
"named": true
|
|
3379
|
+
}
|
|
3380
|
+
]
|
|
3381
|
+
},
|
|
3364
3382
|
"type": {
|
|
3365
3383
|
"multiple": false,
|
|
3366
3384
|
"required": true,
|
|
@@ -3375,24 +3393,6 @@
|
|
|
3375
3393
|
}
|
|
3376
3394
|
]
|
|
3377
3395
|
}
|
|
3378
|
-
},
|
|
3379
|
-
"children": {
|
|
3380
|
-
"multiple": false,
|
|
3381
|
-
"required": true,
|
|
3382
|
-
"types": [
|
|
3383
|
-
{
|
|
3384
|
-
"type": "dictionary_splat_pattern",
|
|
3385
|
-
"named": true
|
|
3386
|
-
},
|
|
3387
|
-
{
|
|
3388
|
-
"type": "identifier",
|
|
3389
|
-
"named": true
|
|
3390
|
-
},
|
|
3391
|
-
{
|
|
3392
|
-
"type": "list_splat_pattern",
|
|
3393
|
-
"named": true
|
|
3394
|
-
}
|
|
3395
|
-
]
|
|
3396
3396
|
}
|
|
3397
3397
|
},
|
|
3398
3398
|
{
|
package/tree-sitter-python.wasm
CHANGED
|
Binary file
|