@willbooster/tree-sitter-python 7.0.0 → 8.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 +6 -4
- package/package.json +1 -1
- package/queries/highlights.scm +0 -5
- package/src/node-types.json +5 -9
- package/tree-sitter-python.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -54,7 +54,6 @@ module.exports = grammar({
|
|
|
54
54
|
[$.tuple, $.tuple_pattern],
|
|
55
55
|
[$.list, $.list_pattern],
|
|
56
56
|
[$.with_item, $.tuple],
|
|
57
|
-
[$.named_expression, $.as_pattern],
|
|
58
57
|
[$.print_statement, $.primary_expression],
|
|
59
58
|
[$.match_statement, $.primary_expression],
|
|
60
59
|
],
|
|
@@ -339,7 +338,10 @@ module.exports = grammar({
|
|
|
339
338
|
optional(token(prec(1, '*'))),
|
|
340
339
|
optional(
|
|
341
340
|
choice(
|
|
342
|
-
seq(
|
|
341
|
+
seq(
|
|
342
|
+
field('value', $.expression),
|
|
343
|
+
optional(seq('as', field('alias', choice($.identifier, $.keyword_identifier))))
|
|
344
|
+
),
|
|
343
345
|
commaSep1(field('value', $.expression))
|
|
344
346
|
)
|
|
345
347
|
),
|
|
@@ -354,7 +356,7 @@ module.exports = grammar({
|
|
|
354
356
|
with_clause: ($) =>
|
|
355
357
|
choice(seq(commaSep1($.with_item), optional(',')), seq('(', commaSep1($.with_item), optional(','), ')')),
|
|
356
358
|
|
|
357
|
-
with_item: ($) => prec.dynamic(1,
|
|
359
|
+
with_item: ($) => prec.dynamic(1, field('value', choice($.expression, $.as_pattern))),
|
|
358
360
|
|
|
359
361
|
function_definition: ($) =>
|
|
360
362
|
seq(
|
|
@@ -643,7 +645,7 @@ module.exports = grammar({
|
|
|
643
645
|
|
|
644
646
|
_expression_within_for_in_clause: ($) => choice($.expression, alias($.lambda_within_for_in_clause, $.lambda)),
|
|
645
647
|
|
|
646
|
-
expression: ($) => choice($._expression_without_named_expression, $.named_expression
|
|
648
|
+
expression: ($) => choice($._expression_without_named_expression, $.named_expression),
|
|
647
649
|
|
|
648
650
|
_expression_without_named_expression: ($) =>
|
|
649
651
|
choice(
|
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
|
@@ -50,11 +50,6 @@
|
|
|
50
50
|
(identifier) @constructor
|
|
51
51
|
(tuple (identifier) @constructor)
|
|
52
52
|
(parenthesized_expression (identifier) @constructor)
|
|
53
|
-
(as_pattern [
|
|
54
|
-
(identifier) @constructor
|
|
55
|
-
(tuple (identifier) @constructor)
|
|
56
|
-
(parenthesized_expression (identifier) @constructor)
|
|
57
|
-
])
|
|
58
53
|
])
|
|
59
54
|
(#match? @constructor "^[0-9_]*[A-Z][A-Z_0-9]*$"))
|
|
60
55
|
|
package/src/node-types.json
CHANGED
|
@@ -3,10 +3,6 @@
|
|
|
3
3
|
"type": "expression",
|
|
4
4
|
"named": true,
|
|
5
5
|
"subtypes": [
|
|
6
|
-
{
|
|
7
|
-
"type": "as_pattern",
|
|
8
|
-
"named": true
|
|
9
|
-
},
|
|
10
6
|
{
|
|
11
7
|
"type": "boolean_operator",
|
|
12
8
|
"named": true
|
|
@@ -306,10 +302,6 @@
|
|
|
306
302
|
"multiple": false,
|
|
307
303
|
"required": true,
|
|
308
304
|
"types": [
|
|
309
|
-
{
|
|
310
|
-
"type": "as_pattern",
|
|
311
|
-
"named": true
|
|
312
|
-
},
|
|
313
305
|
{
|
|
314
306
|
"type": "boolean_operator",
|
|
315
307
|
"named": true
|
|
@@ -1643,7 +1635,7 @@
|
|
|
1643
1635
|
"required": false,
|
|
1644
1636
|
"types": [
|
|
1645
1637
|
{
|
|
1646
|
-
"type": "
|
|
1638
|
+
"type": "identifier",
|
|
1647
1639
|
"named": true
|
|
1648
1640
|
}
|
|
1649
1641
|
]
|
|
@@ -3603,6 +3595,10 @@
|
|
|
3603
3595
|
"multiple": false,
|
|
3604
3596
|
"required": true,
|
|
3605
3597
|
"types": [
|
|
3598
|
+
{
|
|
3599
|
+
"type": "as_pattern",
|
|
3600
|
+
"named": true
|
|
3601
|
+
},
|
|
3606
3602
|
{
|
|
3607
3603
|
"type": "expression",
|
|
3608
3604
|
"named": true
|
package/tree-sitter-python.wasm
CHANGED
|
Binary file
|