@willbooster/tree-sitter-python 2.0.2 → 2.1.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/README.md +3 -2
- package/grammar.js +122 -50
- package/package.json +12 -13
- package/src/node-types.json +184 -87
- package/tree-sitter-python.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -5,14 +5,15 @@
|
|
|
5
5
|
[](https://github.com/WillBooster/tree-sitter-python/actions/workflows/test.yml)
|
|
6
6
|
[](https://github.com/WillBooster/tree-sitter-python/actions/workflows/test-rust.yml)
|
|
7
7
|
[](https://github.com/semantic-release/semantic-release)
|
|
8
|
-
[](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
|
|
9
9
|
[](https://crates.io/crates/willbooster-tree-sitter-python)
|
|
10
10
|
|
|
11
11
|
Python grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
|
|
12
12
|
[tree-sitter/tree-sitter-python](https://github.com/tree-sitter/tree-sitter-python). We are grateful
|
|
13
13
|
to its authors and contributors. This is not an official release of that project.
|
|
14
14
|
|
|
15
|
-
This fork
|
|
15
|
+
This fork builds on upstream v0.25.0 with grammar, scanner, and highlighting fixes, including Python 3.15
|
|
16
|
+
unpacking comprehensions. It ships a compact parser generated by the parser generator of
|
|
16
17
|
[WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter). The parser carries that fork's own ABI number, so
|
|
17
18
|
it loads only with the WillBooster runtime (`willbooster-tree-sitter` or `@willbooster/web-tree-sitter`) 2.0.0 or later,
|
|
18
19
|
not with upstream's tree-sitter.
|
package/grammar.js
CHANGED
|
@@ -17,7 +17,6 @@ const PREC = {
|
|
|
17
17
|
conditional: -1,
|
|
18
18
|
|
|
19
19
|
parenthesized_expression: 1,
|
|
20
|
-
parenthesized_list_splat: 1,
|
|
21
20
|
or: 10,
|
|
22
21
|
and: 11,
|
|
23
22
|
not: 12,
|
|
@@ -46,10 +45,9 @@ module.exports = grammar({
|
|
|
46
45
|
[$.primary_expression, $.list_splat_pattern],
|
|
47
46
|
[$.tuple, $.tuple_pattern],
|
|
48
47
|
[$.list, $.list_pattern],
|
|
49
|
-
[$.with_item, $.
|
|
48
|
+
[$.with_item, $.tuple],
|
|
50
49
|
[$.named_expression, $.as_pattern],
|
|
51
50
|
[$.print_statement, $.primary_expression],
|
|
52
|
-
[$.type_alias_statement, $.primary_expression],
|
|
53
51
|
[$.match_statement, $.primary_expression],
|
|
54
52
|
],
|
|
55
53
|
|
|
@@ -87,6 +85,7 @@ module.exports = grammar({
|
|
|
87
85
|
],
|
|
88
86
|
|
|
89
87
|
inline: ($) => [
|
|
88
|
+
$._expression_without_named_expression,
|
|
90
89
|
$._simple_statement,
|
|
91
90
|
$._compound_statement,
|
|
92
91
|
$._suite,
|
|
@@ -192,8 +191,23 @@ module.exports = grammar({
|
|
|
192
191
|
|
|
193
192
|
print_statement: ($) =>
|
|
194
193
|
choice(
|
|
195
|
-
|
|
196
|
-
prec(
|
|
194
|
+
// Python 3 reads these statements as expression lists, which can unpack their elements.
|
|
195
|
+
prec(
|
|
196
|
+
1,
|
|
197
|
+
seq(
|
|
198
|
+
'print',
|
|
199
|
+
$.chevron,
|
|
200
|
+
repeat(seq(',', field('argument', choice($.expression, $.list_splat)))),
|
|
201
|
+
optional(',')
|
|
202
|
+
)
|
|
203
|
+
),
|
|
204
|
+
prec(
|
|
205
|
+
-3,
|
|
206
|
+
prec.dynamic(
|
|
207
|
+
-1,
|
|
208
|
+
seq('print', commaSep1(field('argument', choice($.expression, $.list_splat))), optional(','))
|
|
209
|
+
)
|
|
210
|
+
)
|
|
197
211
|
),
|
|
198
212
|
|
|
199
213
|
chevron: ($) => seq('>>', $.expression),
|
|
@@ -201,7 +215,13 @@ module.exports = grammar({
|
|
|
201
215
|
assert_statement: ($) => seq('assert', commaSep1($.expression)),
|
|
202
216
|
|
|
203
217
|
expression_statement: ($) =>
|
|
204
|
-
choice(
|
|
218
|
+
choice(
|
|
219
|
+
$.expression,
|
|
220
|
+
seq(choice($.expression, $.list_splat), ',', optional($._collection_elements)),
|
|
221
|
+
$.assignment,
|
|
222
|
+
$.augmented_assignment,
|
|
223
|
+
$.yield
|
|
224
|
+
),
|
|
205
225
|
|
|
206
226
|
named_expression: ($) => seq(field('name', $._named_expression_lhs), ':=', field('value', $.expression)),
|
|
207
227
|
|
|
@@ -248,14 +268,15 @@ module.exports = grammar({
|
|
|
248
268
|
|
|
249
269
|
else_clause: ($) => seq('else', ':', field('body', $._suite)),
|
|
250
270
|
|
|
251
|
-
match_statement: ($) =>
|
|
252
|
-
|
|
271
|
+
match_statement: ($) => {
|
|
272
|
+
const subject = field('subject', choice($.expression, $.list_splat));
|
|
273
|
+
return seq(
|
|
253
274
|
'match',
|
|
254
|
-
|
|
255
|
-
optional(','),
|
|
275
|
+
choice(field('subject', $.expression), seq(subject, ',', optional(seq(commaSep1(subject), optional(','))))),
|
|
256
276
|
':',
|
|
257
277
|
field('body', alias($._match_block, $.block))
|
|
258
|
-
)
|
|
278
|
+
);
|
|
279
|
+
},
|
|
259
280
|
|
|
260
281
|
_match_block: ($) => choice(seq($._indent, repeat(field('alternative', $.case_clause)), $._dedent), $._newline),
|
|
261
282
|
|
|
@@ -339,9 +360,9 @@ module.exports = grammar({
|
|
|
339
360
|
|
|
340
361
|
lambda_parameters: ($) => $._parameters,
|
|
341
362
|
|
|
342
|
-
list_splat: ($) => seq('*', $.
|
|
363
|
+
list_splat: ($) => seq('*', $.primary_expression),
|
|
343
364
|
|
|
344
|
-
dictionary_splat: ($) => seq('**', $.
|
|
365
|
+
dictionary_splat: ($) => seq('**', $.primary_expression),
|
|
345
366
|
|
|
346
367
|
global_statement: ($) => seq('global', commaSep1($.identifier)),
|
|
347
368
|
|
|
@@ -350,7 +371,12 @@ module.exports = grammar({
|
|
|
350
371
|
exec_statement: ($) =>
|
|
351
372
|
seq('exec', field('code', choice($.string, $.identifier)), optional(seq('in', commaSep1($.expression)))),
|
|
352
373
|
|
|
353
|
-
type_alias_statement: ($) =>
|
|
374
|
+
type_alias_statement: ($) =>
|
|
375
|
+
seq('type', field('left', alias($._type_alias_name, $.type)), '=', field('right', $.type)),
|
|
376
|
+
|
|
377
|
+
_type_alias_name: ($) => choice($.identifier, alias($._generic_type_definition, $.generic_type)),
|
|
378
|
+
|
|
379
|
+
_generic_type_definition: ($) => seq($.identifier, $.type_parameter),
|
|
354
380
|
|
|
355
381
|
class_definition: ($) =>
|
|
356
382
|
seq(
|
|
@@ -361,13 +387,10 @@ module.exports = grammar({
|
|
|
361
387
|
':',
|
|
362
388
|
field('body', $._suite)
|
|
363
389
|
),
|
|
364
|
-
type_parameter: ($) => seq('[', commaSep1($.type), optional(','), ']'),
|
|
390
|
+
type_parameter: ($) => seq('[', commaSep1(choice($.type, $.splat_type)), optional(','), ']'),
|
|
365
391
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
PREC.parenthesized_list_splat,
|
|
369
|
-
seq('(', choice(alias($.parenthesized_list_splat, $.parenthesized_expression), $.list_splat), ')')
|
|
370
|
-
),
|
|
392
|
+
_generic_type_arguments: ($) =>
|
|
393
|
+
seq('[', commaSep1(choice($.type, alias($._list_splat_argument, $.splat_type))), optional(','), ']'),
|
|
371
394
|
|
|
372
395
|
argument_list: ($) =>
|
|
373
396
|
seq(
|
|
@@ -376,9 +399,8 @@ module.exports = grammar({
|
|
|
376
399
|
commaSep1(
|
|
377
400
|
choice(
|
|
378
401
|
$.expression,
|
|
379
|
-
$.list_splat,
|
|
380
|
-
$.dictionary_splat,
|
|
381
|
-
alias($.parenthesized_list_splat, $.parenthesized_expression),
|
|
402
|
+
alias($._list_splat_argument, $.list_splat),
|
|
403
|
+
alias($._dictionary_splat_argument, $.dictionary_splat),
|
|
382
404
|
$.keyword_argument
|
|
383
405
|
)
|
|
384
406
|
)
|
|
@@ -387,6 +409,10 @@ module.exports = grammar({
|
|
|
387
409
|
')'
|
|
388
410
|
),
|
|
389
411
|
|
|
412
|
+
_list_splat_argument: ($) => seq('*', $._expression_without_named_expression),
|
|
413
|
+
|
|
414
|
+
_dictionary_splat_argument: ($) => seq('**', $._expression_without_named_expression),
|
|
415
|
+
|
|
390
416
|
decorated_definition: ($) =>
|
|
391
417
|
seq(repeat1($.decorator), field('definition', choice($.class_definition, $.function_definition))),
|
|
392
418
|
|
|
@@ -397,7 +423,7 @@ module.exports = grammar({
|
|
|
397
423
|
block: ($) => seq(repeat($._statement), $._dedent),
|
|
398
424
|
|
|
399
425
|
expression_list: ($) =>
|
|
400
|
-
prec.right(seq($.expression,
|
|
426
|
+
prec.dynamic(1, prec.right(seq(choice($.expression, $.list_splat), ',', optional($._collection_elements)))),
|
|
401
427
|
|
|
402
428
|
dotted_name: ($) => prec(1, sep1($.identifier, '.')),
|
|
403
429
|
|
|
@@ -504,16 +530,16 @@ module.exports = grammar({
|
|
|
504
530
|
|
|
505
531
|
_expression_within_for_in_clause: ($) => choice($.expression, alias($.lambda_within_for_in_clause, $.lambda)),
|
|
506
532
|
|
|
507
|
-
expression: ($) =>
|
|
533
|
+
expression: ($) => choice($._expression_without_named_expression, $.named_expression, $.as_pattern),
|
|
534
|
+
|
|
535
|
+
_expression_without_named_expression: ($) =>
|
|
508
536
|
choice(
|
|
509
537
|
$.comparison_operator,
|
|
510
538
|
$.not_operator,
|
|
511
539
|
$.boolean_operator,
|
|
512
540
|
$.lambda,
|
|
513
541
|
$.primary_expression,
|
|
514
|
-
$.conditional_expression
|
|
515
|
-
$.named_expression,
|
|
516
|
-
$.as_pattern
|
|
542
|
+
$.conditional_expression
|
|
517
543
|
),
|
|
518
544
|
|
|
519
545
|
primary_expression: ($) =>
|
|
@@ -542,16 +568,29 @@ module.exports = grammar({
|
|
|
542
568
|
$.tuple,
|
|
543
569
|
$.parenthesized_expression,
|
|
544
570
|
$.generator_expression,
|
|
545
|
-
$.ellipsis
|
|
546
|
-
alias($.list_splat_pattern, $.list_splat)
|
|
571
|
+
$.ellipsis
|
|
547
572
|
),
|
|
548
573
|
|
|
549
|
-
not_operator: ($) => prec(PREC.not, seq('not', field('argument', $.
|
|
574
|
+
not_operator: ($) => prec(PREC.not, seq('not', field('argument', $._expression_without_named_expression))),
|
|
550
575
|
|
|
551
576
|
boolean_operator: ($) =>
|
|
552
577
|
choice(
|
|
553
|
-
prec.left(
|
|
554
|
-
|
|
578
|
+
prec.left(
|
|
579
|
+
PREC.and,
|
|
580
|
+
seq(
|
|
581
|
+
field('left', $._expression_without_named_expression),
|
|
582
|
+
field('operator', 'and'),
|
|
583
|
+
field('right', $._expression_without_named_expression)
|
|
584
|
+
)
|
|
585
|
+
),
|
|
586
|
+
prec.left(
|
|
587
|
+
PREC.or,
|
|
588
|
+
seq(
|
|
589
|
+
field('left', $._expression_without_named_expression),
|
|
590
|
+
field('operator', 'or'),
|
|
591
|
+
field('right', $._expression_without_named_expression)
|
|
592
|
+
)
|
|
593
|
+
)
|
|
555
594
|
),
|
|
556
595
|
|
|
557
596
|
binary_operator: ($) => {
|
|
@@ -623,7 +662,12 @@ module.exports = grammar({
|
|
|
623
662
|
lambda: ($) =>
|
|
624
663
|
prec(
|
|
625
664
|
PREC.lambda,
|
|
626
|
-
seq(
|
|
665
|
+
seq(
|
|
666
|
+
'lambda',
|
|
667
|
+
field('parameters', optional($.lambda_parameters)),
|
|
668
|
+
':',
|
|
669
|
+
field('body', $._expression_without_named_expression)
|
|
670
|
+
)
|
|
627
671
|
),
|
|
628
672
|
|
|
629
673
|
lambda_within_for_in_clause: ($) =>
|
|
@@ -655,8 +699,7 @@ module.exports = grammar({
|
|
|
655
699
|
|
|
656
700
|
pattern_list: ($) => seq($.pattern, choice(',', seq(repeat1(seq(',', $.pattern)), optional(',')))),
|
|
657
701
|
|
|
658
|
-
_right_hand_side: ($) =>
|
|
659
|
-
choice($.expression, $.expression_list, $.assignment, $.augmented_assignment, $.pattern_list, $.yield),
|
|
702
|
+
_right_hand_side: ($) => choice($.expression, $.expression_list, $.assignment, $.augmented_assignment, $.yield),
|
|
660
703
|
|
|
661
704
|
yield: ($) => prec.right(seq('yield', choice(seq('from', $.expression), optional($._expressions)))),
|
|
662
705
|
|
|
@@ -669,7 +712,7 @@ module.exports = grammar({
|
|
|
669
712
|
seq(
|
|
670
713
|
field('value', $.primary_expression),
|
|
671
714
|
'[',
|
|
672
|
-
commaSep1(field('subscript', choice($.expression, $.slice))),
|
|
715
|
+
commaSep1(field('subscript', choice($.expression, alias($._list_splat_argument, $.list_splat), $.slice))),
|
|
673
716
|
optional(','),
|
|
674
717
|
']'
|
|
675
718
|
)
|
|
@@ -691,13 +734,19 @@ module.exports = grammar({
|
|
|
691
734
|
typed_parameter: ($) =>
|
|
692
735
|
prec(
|
|
693
736
|
PREC.typed_parameter,
|
|
694
|
-
|
|
737
|
+
choice(
|
|
738
|
+
seq(choice($.identifier, $.dictionary_splat_pattern), ':', field('type', $.type)),
|
|
739
|
+
seq($.list_splat_pattern, ':', field('type', choice($.type, alias($.list_splat, $.splat_type))))
|
|
740
|
+
)
|
|
695
741
|
),
|
|
696
742
|
|
|
697
|
-
type: ($) =>
|
|
698
|
-
choice(prec(1, $.expression), $.splat_type, $.generic_type, $.union_type, $.constrained_type, $.member_type),
|
|
743
|
+
type: ($) => choice(prec(1, $.expression), $.generic_type, $.union_type, $.constrained_type, $.member_type),
|
|
699
744
|
splat_type: ($) => prec(1, seq(choice('*', '**'), $.identifier)),
|
|
700
|
-
generic_type: ($) =>
|
|
745
|
+
generic_type: ($) =>
|
|
746
|
+
prec(
|
|
747
|
+
1,
|
|
748
|
+
seq(choice($.identifier, alias('type', $.identifier)), alias($._generic_type_arguments, $.type_parameter))
|
|
749
|
+
),
|
|
701
750
|
union_type: ($) => prec.left(seq($.type, '|', $.type)),
|
|
702
751
|
constrained_type: ($) => prec.right(seq($.type, ':', $.type)),
|
|
703
752
|
member_type: ($) => seq($.type, '.', $.identifier),
|
|
@@ -711,26 +760,40 @@ module.exports = grammar({
|
|
|
711
760
|
|
|
712
761
|
set: ($) => seq('{', $._collection_elements, '}'),
|
|
713
762
|
|
|
714
|
-
tuple: ($) =>
|
|
763
|
+
tuple: ($) =>
|
|
764
|
+
seq('(', optional(seq(choice($.expression, $.list_splat), ',', optional($._collection_elements))), ')'),
|
|
715
765
|
|
|
716
766
|
dictionary: ($) => seq('{', optional(commaSep1(choice($.pair, $.dictionary_splat))), optional(','), '}'),
|
|
717
767
|
|
|
718
768
|
pair: ($) => seq(field('key', $.expression), ':', field('value', $.expression)),
|
|
719
769
|
|
|
720
|
-
list_comprehension: ($) =>
|
|
770
|
+
list_comprehension: ($) =>
|
|
771
|
+
seq('[', field('body', choice($.expression, $.list_splat)), $._comprehension_clauses, ']'),
|
|
721
772
|
|
|
722
|
-
dictionary_comprehension: ($) =>
|
|
773
|
+
dictionary_comprehension: ($) =>
|
|
774
|
+
seq(
|
|
775
|
+
'{',
|
|
776
|
+
field('body', choice($.pair, alias($._dictionary_splat_argument, $.dictionary_splat))),
|
|
777
|
+
$._comprehension_clauses,
|
|
778
|
+
'}'
|
|
779
|
+
),
|
|
723
780
|
|
|
724
|
-
set_comprehension: ($) =>
|
|
781
|
+
set_comprehension: ($) =>
|
|
782
|
+
seq('{', field('body', choice($.expression, $.list_splat)), $._comprehension_clauses, '}'),
|
|
725
783
|
|
|
726
|
-
generator_expression: ($) =>
|
|
784
|
+
generator_expression: ($) =>
|
|
785
|
+
seq(
|
|
786
|
+
'(',
|
|
787
|
+
field('body', choice($.expression, alias($._list_splat_argument, $.list_splat))),
|
|
788
|
+
$._comprehension_clauses,
|
|
789
|
+
')'
|
|
790
|
+
),
|
|
727
791
|
|
|
728
792
|
_comprehension_clauses: ($) => seq($.for_in_clause, repeat(choice($.for_in_clause, $.if_clause))),
|
|
729
793
|
|
|
730
794
|
parenthesized_expression: ($) => prec(PREC.parenthesized_expression, seq('(', choice($.expression, $.yield), ')')),
|
|
731
795
|
|
|
732
|
-
_collection_elements: ($) =>
|
|
733
|
-
seq(commaSep1(choice($.expression, $.yield, $.list_splat, $.parenthesized_list_splat)), optional(',')),
|
|
796
|
+
_collection_elements: ($) => seq(commaSep1(choice($.expression, $.list_splat)), optional(',')),
|
|
734
797
|
|
|
735
798
|
for_in_clause: ($) =>
|
|
736
799
|
prec.left(
|
|
@@ -747,7 +810,16 @@ module.exports = grammar({
|
|
|
747
810
|
if_clause: ($) => seq('if', $.expression),
|
|
748
811
|
|
|
749
812
|
conditional_expression: ($) =>
|
|
750
|
-
prec.right(
|
|
813
|
+
prec.right(
|
|
814
|
+
PREC.conditional,
|
|
815
|
+
seq(
|
|
816
|
+
$._expression_without_named_expression,
|
|
817
|
+
'if',
|
|
818
|
+
$._expression_without_named_expression,
|
|
819
|
+
'else',
|
|
820
|
+
$._expression_without_named_expression
|
|
821
|
+
)
|
|
822
|
+
),
|
|
751
823
|
|
|
752
824
|
concatenated_string: ($) => seq($.string, repeat1($.string)),
|
|
753
825
|
|
|
@@ -766,7 +838,7 @@ module.exports = grammar({
|
|
|
766
838
|
'}'
|
|
767
839
|
),
|
|
768
840
|
|
|
769
|
-
_f_expression: ($) => choice($.expression, $.expression_list, $.
|
|
841
|
+
_f_expression: ($) => choice($.expression, $.expression_list, $.yield),
|
|
770
842
|
|
|
771
843
|
escape_sequence: () =>
|
|
772
844
|
token.immediate(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-python",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Python grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -46,21 +46,20 @@
|
|
|
46
46
|
"@vitest/browser-playwright": "5.0.3",
|
|
47
47
|
"@willbooster/oxfmt-config": "1.2.2",
|
|
48
48
|
"@willbooster/oxlint-config": "1.4.8",
|
|
49
|
-
"@willbooster/wb": "22.
|
|
50
|
-
"@willbooster/web-tree-sitter": "2.0.
|
|
51
|
-
"conventional-changelog-conventionalcommits": "10.4.
|
|
52
|
-
"lefthook": "2.1
|
|
53
|
-
"oxfmt": "0.
|
|
54
|
-
"oxlint": "1.
|
|
55
|
-
"oxlint-tsgolint": "7.0.
|
|
56
|
-
"playwright": "1.
|
|
49
|
+
"@willbooster/wb": "22.26.1",
|
|
50
|
+
"@willbooster/web-tree-sitter": "2.0.27",
|
|
51
|
+
"conventional-changelog-conventionalcommits": "10.4.1",
|
|
52
|
+
"lefthook": "2.2.1",
|
|
53
|
+
"oxfmt": "0.72.0",
|
|
54
|
+
"oxlint": "1.87.0",
|
|
55
|
+
"oxlint-tsgolint": "7.0.2004",
|
|
56
|
+
"playwright": "1.64.0",
|
|
57
57
|
"semantic-release": "25.0.9",
|
|
58
58
|
"sort-package-json": "4.0.0",
|
|
59
|
-
"tree-sitter-cli": "0.27.
|
|
60
|
-
"
|
|
61
|
-
"vite": "8.3.2",
|
|
59
|
+
"tree-sitter-cli": "0.27.1",
|
|
60
|
+
"vite": "8.3.4",
|
|
62
61
|
"vitest": "5.0.3",
|
|
63
|
-
"wrangler": "4.
|
|
62
|
+
"wrangler": "4.149.0"
|
|
64
63
|
},
|
|
65
64
|
"peerDependencies": {
|
|
66
65
|
"@willbooster/web-tree-sitter": "^2.0.0"
|
package/src/node-types.json
CHANGED
|
@@ -173,10 +173,6 @@
|
|
|
173
173
|
"type": "list_comprehension",
|
|
174
174
|
"named": true
|
|
175
175
|
},
|
|
176
|
-
{
|
|
177
|
-
"type": "list_splat",
|
|
178
|
-
"named": true
|
|
179
|
-
},
|
|
180
176
|
{
|
|
181
177
|
"type": "none",
|
|
182
178
|
"named": true
|
|
@@ -264,10 +260,6 @@
|
|
|
264
260
|
{
|
|
265
261
|
"type": "list_splat",
|
|
266
262
|
"named": true
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
"type": "parenthesized_expression",
|
|
270
|
-
"named": true
|
|
271
263
|
}
|
|
272
264
|
]
|
|
273
265
|
}
|
|
@@ -402,10 +394,6 @@
|
|
|
402
394
|
"type": "expression_list",
|
|
403
395
|
"named": true
|
|
404
396
|
},
|
|
405
|
-
{
|
|
406
|
-
"type": "pattern_list",
|
|
407
|
-
"named": true
|
|
408
|
-
},
|
|
409
397
|
{
|
|
410
398
|
"type": "yield",
|
|
411
399
|
"named": true
|
|
@@ -546,10 +534,6 @@
|
|
|
546
534
|
"type": "expression_list",
|
|
547
535
|
"named": true
|
|
548
536
|
},
|
|
549
|
-
{
|
|
550
|
-
"type": "pattern_list",
|
|
551
|
-
"named": true
|
|
552
|
-
},
|
|
553
537
|
{
|
|
554
538
|
"type": "yield",
|
|
555
539
|
"named": true
|
|
@@ -788,7 +772,27 @@
|
|
|
788
772
|
"required": true,
|
|
789
773
|
"types": [
|
|
790
774
|
{
|
|
791
|
-
"type": "
|
|
775
|
+
"type": "boolean_operator",
|
|
776
|
+
"named": true
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"type": "comparison_operator",
|
|
780
|
+
"named": true
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
"type": "conditional_expression",
|
|
784
|
+
"named": true
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
"type": "lambda",
|
|
788
|
+
"named": true
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
"type": "not_operator",
|
|
792
|
+
"named": true
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
"type": "primary_expression",
|
|
792
796
|
"named": true
|
|
793
797
|
}
|
|
794
798
|
]
|
|
@@ -812,7 +816,27 @@
|
|
|
812
816
|
"required": true,
|
|
813
817
|
"types": [
|
|
814
818
|
{
|
|
815
|
-
"type": "
|
|
819
|
+
"type": "boolean_operator",
|
|
820
|
+
"named": true
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
"type": "comparison_operator",
|
|
824
|
+
"named": true
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
"type": "conditional_expression",
|
|
828
|
+
"named": true
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
"type": "lambda",
|
|
832
|
+
"named": true
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
"type": "not_operator",
|
|
836
|
+
"named": true
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
"type": "primary_expression",
|
|
816
840
|
"named": true
|
|
817
841
|
}
|
|
818
842
|
]
|
|
@@ -1158,7 +1182,27 @@
|
|
|
1158
1182
|
"required": true,
|
|
1159
1183
|
"types": [
|
|
1160
1184
|
{
|
|
1161
|
-
"type": "
|
|
1185
|
+
"type": "boolean_operator",
|
|
1186
|
+
"named": true
|
|
1187
|
+
},
|
|
1188
|
+
{
|
|
1189
|
+
"type": "comparison_operator",
|
|
1190
|
+
"named": true
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
"type": "conditional_expression",
|
|
1194
|
+
"named": true
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
"type": "lambda",
|
|
1198
|
+
"named": true
|
|
1199
|
+
},
|
|
1200
|
+
{
|
|
1201
|
+
"type": "not_operator",
|
|
1202
|
+
"named": true
|
|
1203
|
+
},
|
|
1204
|
+
{
|
|
1205
|
+
"type": "primary_expression",
|
|
1162
1206
|
"named": true
|
|
1163
1207
|
}
|
|
1164
1208
|
]
|
|
@@ -1405,6 +1449,10 @@
|
|
|
1405
1449
|
"multiple": false,
|
|
1406
1450
|
"required": true,
|
|
1407
1451
|
"types": [
|
|
1452
|
+
{
|
|
1453
|
+
"type": "dictionary_splat",
|
|
1454
|
+
"named": true
|
|
1455
|
+
},
|
|
1408
1456
|
{
|
|
1409
1457
|
"type": "pair",
|
|
1410
1458
|
"named": true
|
|
@@ -1436,7 +1484,27 @@
|
|
|
1436
1484
|
"required": true,
|
|
1437
1485
|
"types": [
|
|
1438
1486
|
{
|
|
1439
|
-
"type": "
|
|
1487
|
+
"type": "boolean_operator",
|
|
1488
|
+
"named": true
|
|
1489
|
+
},
|
|
1490
|
+
{
|
|
1491
|
+
"type": "comparison_operator",
|
|
1492
|
+
"named": true
|
|
1493
|
+
},
|
|
1494
|
+
{
|
|
1495
|
+
"type": "conditional_expression",
|
|
1496
|
+
"named": true
|
|
1497
|
+
},
|
|
1498
|
+
{
|
|
1499
|
+
"type": "lambda",
|
|
1500
|
+
"named": true
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
"type": "not_operator",
|
|
1504
|
+
"named": true
|
|
1505
|
+
},
|
|
1506
|
+
{
|
|
1507
|
+
"type": "primary_expression",
|
|
1440
1508
|
"named": true
|
|
1441
1509
|
}
|
|
1442
1510
|
]
|
|
@@ -1599,6 +1667,10 @@
|
|
|
1599
1667
|
{
|
|
1600
1668
|
"type": "expression",
|
|
1601
1669
|
"named": true
|
|
1670
|
+
},
|
|
1671
|
+
{
|
|
1672
|
+
"type": "list_splat",
|
|
1673
|
+
"named": true
|
|
1602
1674
|
}
|
|
1603
1675
|
]
|
|
1604
1676
|
}
|
|
@@ -1623,6 +1695,10 @@
|
|
|
1623
1695
|
"type": "expression",
|
|
1624
1696
|
"named": true
|
|
1625
1697
|
},
|
|
1698
|
+
{
|
|
1699
|
+
"type": "list_splat",
|
|
1700
|
+
"named": true
|
|
1701
|
+
},
|
|
1626
1702
|
{
|
|
1627
1703
|
"type": "yield",
|
|
1628
1704
|
"named": true
|
|
@@ -1749,10 +1825,6 @@
|
|
|
1749
1825
|
"type": "expression_list",
|
|
1750
1826
|
"named": true
|
|
1751
1827
|
},
|
|
1752
|
-
{
|
|
1753
|
-
"type": "pattern_list",
|
|
1754
|
-
"named": true
|
|
1755
|
-
},
|
|
1756
1828
|
{
|
|
1757
1829
|
"type": "yield",
|
|
1758
1830
|
"named": true
|
|
@@ -1883,6 +1955,10 @@
|
|
|
1883
1955
|
{
|
|
1884
1956
|
"type": "expression",
|
|
1885
1957
|
"named": true
|
|
1958
|
+
},
|
|
1959
|
+
{
|
|
1960
|
+
"type": "list_splat",
|
|
1961
|
+
"named": true
|
|
1886
1962
|
}
|
|
1887
1963
|
]
|
|
1888
1964
|
}
|
|
@@ -2076,10 +2152,6 @@
|
|
|
2076
2152
|
"type": "expression_list",
|
|
2077
2153
|
"named": true
|
|
2078
2154
|
},
|
|
2079
|
-
{
|
|
2080
|
-
"type": "pattern_list",
|
|
2081
|
-
"named": true
|
|
2082
|
-
},
|
|
2083
2155
|
{
|
|
2084
2156
|
"type": "yield",
|
|
2085
2157
|
"named": true
|
|
@@ -2275,14 +2347,6 @@
|
|
|
2275
2347
|
{
|
|
2276
2348
|
"type": "list_splat",
|
|
2277
2349
|
"named": true
|
|
2278
|
-
},
|
|
2279
|
-
{
|
|
2280
|
-
"type": "parenthesized_list_splat",
|
|
2281
|
-
"named": true
|
|
2282
|
-
},
|
|
2283
|
-
{
|
|
2284
|
-
"type": "yield",
|
|
2285
|
-
"named": true
|
|
2286
2350
|
}
|
|
2287
2351
|
]
|
|
2288
2352
|
}
|
|
@@ -2298,6 +2362,10 @@
|
|
|
2298
2362
|
{
|
|
2299
2363
|
"type": "expression",
|
|
2300
2364
|
"named": true
|
|
2365
|
+
},
|
|
2366
|
+
{
|
|
2367
|
+
"type": "list_splat",
|
|
2368
|
+
"named": true
|
|
2301
2369
|
}
|
|
2302
2370
|
]
|
|
2303
2371
|
}
|
|
@@ -2345,19 +2413,27 @@
|
|
|
2345
2413
|
"required": true,
|
|
2346
2414
|
"types": [
|
|
2347
2415
|
{
|
|
2348
|
-
"type": "
|
|
2416
|
+
"type": "boolean_operator",
|
|
2349
2417
|
"named": true
|
|
2350
2418
|
},
|
|
2351
2419
|
{
|
|
2352
|
-
"type": "
|
|
2420
|
+
"type": "comparison_operator",
|
|
2353
2421
|
"named": true
|
|
2354
2422
|
},
|
|
2355
2423
|
{
|
|
2356
|
-
"type": "
|
|
2424
|
+
"type": "conditional_expression",
|
|
2357
2425
|
"named": true
|
|
2358
2426
|
},
|
|
2359
2427
|
{
|
|
2360
|
-
"type": "
|
|
2428
|
+
"type": "lambda",
|
|
2429
|
+
"named": true
|
|
2430
|
+
},
|
|
2431
|
+
{
|
|
2432
|
+
"type": "not_operator",
|
|
2433
|
+
"named": true
|
|
2434
|
+
},
|
|
2435
|
+
{
|
|
2436
|
+
"type": "primary_expression",
|
|
2361
2437
|
"named": true
|
|
2362
2438
|
}
|
|
2363
2439
|
]
|
|
@@ -2407,6 +2483,10 @@
|
|
|
2407
2483
|
{
|
|
2408
2484
|
"type": "expression",
|
|
2409
2485
|
"named": true
|
|
2486
|
+
},
|
|
2487
|
+
{
|
|
2488
|
+
"type": "list_splat",
|
|
2489
|
+
"named": true
|
|
2410
2490
|
}
|
|
2411
2491
|
]
|
|
2412
2492
|
}
|
|
@@ -2598,7 +2678,27 @@
|
|
|
2598
2678
|
"required": true,
|
|
2599
2679
|
"types": [
|
|
2600
2680
|
{
|
|
2601
|
-
"type": "
|
|
2681
|
+
"type": "boolean_operator",
|
|
2682
|
+
"named": true
|
|
2683
|
+
},
|
|
2684
|
+
{
|
|
2685
|
+
"type": "comparison_operator",
|
|
2686
|
+
"named": true
|
|
2687
|
+
},
|
|
2688
|
+
{
|
|
2689
|
+
"type": "conditional_expression",
|
|
2690
|
+
"named": true
|
|
2691
|
+
},
|
|
2692
|
+
{
|
|
2693
|
+
"type": "lambda",
|
|
2694
|
+
"named": true
|
|
2695
|
+
},
|
|
2696
|
+
{
|
|
2697
|
+
"type": "not_operator",
|
|
2698
|
+
"named": true
|
|
2699
|
+
},
|
|
2700
|
+
{
|
|
2701
|
+
"type": "primary_expression",
|
|
2602
2702
|
"named": true
|
|
2603
2703
|
}
|
|
2604
2704
|
]
|
|
@@ -2658,14 +2758,6 @@
|
|
|
2658
2758
|
"type": "expression",
|
|
2659
2759
|
"named": true
|
|
2660
2760
|
},
|
|
2661
|
-
{
|
|
2662
|
-
"type": "list_splat",
|
|
2663
|
-
"named": true
|
|
2664
|
-
},
|
|
2665
|
-
{
|
|
2666
|
-
"type": "parenthesized_expression",
|
|
2667
|
-
"named": true
|
|
2668
|
-
},
|
|
2669
2761
|
{
|
|
2670
2762
|
"type": "yield",
|
|
2671
2763
|
"named": true
|
|
@@ -2673,25 +2765,6 @@
|
|
|
2673
2765
|
]
|
|
2674
2766
|
}
|
|
2675
2767
|
},
|
|
2676
|
-
{
|
|
2677
|
-
"type": "parenthesized_list_splat",
|
|
2678
|
-
"named": true,
|
|
2679
|
-
"fields": {},
|
|
2680
|
-
"children": {
|
|
2681
|
-
"multiple": false,
|
|
2682
|
-
"required": true,
|
|
2683
|
-
"types": [
|
|
2684
|
-
{
|
|
2685
|
-
"type": "list_splat",
|
|
2686
|
-
"named": true
|
|
2687
|
-
},
|
|
2688
|
-
{
|
|
2689
|
-
"type": "parenthesized_expression",
|
|
2690
|
-
"named": true
|
|
2691
|
-
}
|
|
2692
|
-
]
|
|
2693
|
-
}
|
|
2694
|
-
},
|
|
2695
2768
|
{
|
|
2696
2769
|
"type": "pass_statement",
|
|
2697
2770
|
"named": true,
|
|
@@ -2728,6 +2801,10 @@
|
|
|
2728
2801
|
{
|
|
2729
2802
|
"type": "expression",
|
|
2730
2803
|
"named": true
|
|
2804
|
+
},
|
|
2805
|
+
{
|
|
2806
|
+
"type": "list_splat",
|
|
2807
|
+
"named": true
|
|
2731
2808
|
}
|
|
2732
2809
|
]
|
|
2733
2810
|
}
|
|
@@ -2826,14 +2903,6 @@
|
|
|
2826
2903
|
{
|
|
2827
2904
|
"type": "list_splat",
|
|
2828
2905
|
"named": true
|
|
2829
|
-
},
|
|
2830
|
-
{
|
|
2831
|
-
"type": "parenthesized_list_splat",
|
|
2832
|
-
"named": true
|
|
2833
|
-
},
|
|
2834
|
-
{
|
|
2835
|
-
"type": "yield",
|
|
2836
|
-
"named": true
|
|
2837
2906
|
}
|
|
2838
2907
|
]
|
|
2839
2908
|
}
|
|
@@ -2849,6 +2918,10 @@
|
|
|
2849
2918
|
{
|
|
2850
2919
|
"type": "expression",
|
|
2851
2920
|
"named": true
|
|
2921
|
+
},
|
|
2922
|
+
{
|
|
2923
|
+
"type": "list_splat",
|
|
2924
|
+
"named": true
|
|
2852
2925
|
}
|
|
2853
2926
|
]
|
|
2854
2927
|
}
|
|
@@ -2907,7 +2980,27 @@
|
|
|
2907
2980
|
"required": true,
|
|
2908
2981
|
"types": [
|
|
2909
2982
|
{
|
|
2910
|
-
"type": "
|
|
2983
|
+
"type": "boolean_operator",
|
|
2984
|
+
"named": true
|
|
2985
|
+
},
|
|
2986
|
+
{
|
|
2987
|
+
"type": "comparison_operator",
|
|
2988
|
+
"named": true
|
|
2989
|
+
},
|
|
2990
|
+
{
|
|
2991
|
+
"type": "conditional_expression",
|
|
2992
|
+
"named": true
|
|
2993
|
+
},
|
|
2994
|
+
{
|
|
2995
|
+
"type": "lambda",
|
|
2996
|
+
"named": true
|
|
2997
|
+
},
|
|
2998
|
+
{
|
|
2999
|
+
"type": "not_operator",
|
|
3000
|
+
"named": true
|
|
3001
|
+
},
|
|
3002
|
+
{
|
|
3003
|
+
"type": "primary_expression",
|
|
2911
3004
|
"named": true
|
|
2912
3005
|
}
|
|
2913
3006
|
]
|
|
@@ -2971,6 +3064,10 @@
|
|
|
2971
3064
|
"type": "expression",
|
|
2972
3065
|
"named": true
|
|
2973
3066
|
},
|
|
3067
|
+
{
|
|
3068
|
+
"type": "list_splat",
|
|
3069
|
+
"named": true
|
|
3070
|
+
},
|
|
2974
3071
|
{
|
|
2975
3072
|
"type": "slice",
|
|
2976
3073
|
"named": true
|
|
@@ -3038,14 +3135,6 @@
|
|
|
3038
3135
|
{
|
|
3039
3136
|
"type": "list_splat",
|
|
3040
3137
|
"named": true
|
|
3041
|
-
},
|
|
3042
|
-
{
|
|
3043
|
-
"type": "parenthesized_list_splat",
|
|
3044
|
-
"named": true
|
|
3045
|
-
},
|
|
3046
|
-
{
|
|
3047
|
-
"type": "yield",
|
|
3048
|
-
"named": true
|
|
3049
3138
|
}
|
|
3050
3139
|
]
|
|
3051
3140
|
}
|
|
@@ -3090,11 +3179,11 @@
|
|
|
3090
3179
|
"named": true
|
|
3091
3180
|
},
|
|
3092
3181
|
{
|
|
3093
|
-
"type": "
|
|
3182
|
+
"type": "identifier",
|
|
3094
3183
|
"named": true
|
|
3095
3184
|
},
|
|
3096
3185
|
{
|
|
3097
|
-
"type": "
|
|
3186
|
+
"type": "member_type",
|
|
3098
3187
|
"named": true
|
|
3099
3188
|
},
|
|
3100
3189
|
{
|
|
@@ -3138,6 +3227,10 @@
|
|
|
3138
3227
|
"multiple": true,
|
|
3139
3228
|
"required": true,
|
|
3140
3229
|
"types": [
|
|
3230
|
+
{
|
|
3231
|
+
"type": "splat_type",
|
|
3232
|
+
"named": true
|
|
3233
|
+
},
|
|
3141
3234
|
{
|
|
3142
3235
|
"type": "type",
|
|
3143
3236
|
"named": true
|
|
@@ -3189,6 +3282,10 @@
|
|
|
3189
3282
|
"multiple": false,
|
|
3190
3283
|
"required": true,
|
|
3191
3284
|
"types": [
|
|
3285
|
+
{
|
|
3286
|
+
"type": "splat_type",
|
|
3287
|
+
"named": true
|
|
3288
|
+
},
|
|
3192
3289
|
{
|
|
3193
3290
|
"type": "type",
|
|
3194
3291
|
"named": true
|
package/tree-sitter-python.wasm
CHANGED
|
Binary file
|