@willbooster/tree-sitter-python 2.1.2 → 2.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 +4 -1
- package/package.json +1 -1
- package/queries/highlights.scm +2 -0
- package/src/node-types.json +31 -0
- package/tree-sitter-python.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -152,6 +152,7 @@ module.exports = grammar({
|
|
|
152
152
|
choice(
|
|
153
153
|
$.future_import_statement,
|
|
154
154
|
$.import_statement,
|
|
155
|
+
$.lazy_import_statement,
|
|
155
156
|
$.import_from_statement,
|
|
156
157
|
$.print_statement,
|
|
157
158
|
$.assert_statement,
|
|
@@ -170,6 +171,8 @@ module.exports = grammar({
|
|
|
170
171
|
|
|
171
172
|
import_statement: ($) => seq('import', $._import_list),
|
|
172
173
|
|
|
174
|
+
lazy_import_statement: ($) => seq('lazy', choice($.import_statement, $.import_from_statement)),
|
|
175
|
+
|
|
173
176
|
import_prefix: () => repeat1('.'),
|
|
174
177
|
|
|
175
178
|
relative_import: ($) => seq($.import_prefix, optional($.dotted_name)),
|
|
@@ -913,7 +916,7 @@ module.exports = grammar({
|
|
|
913
916
|
keyword_identifier: ($) =>
|
|
914
917
|
choice(
|
|
915
918
|
prec(-3, alias(choice('print', 'exec', 'async', 'await'), $.identifier)),
|
|
916
|
-
alias(choice('type', 'match'), $.identifier)
|
|
919
|
+
alias(choice('type', 'match', 'lazy'), $.identifier)
|
|
917
920
|
),
|
|
918
921
|
|
|
919
922
|
true: () => 'True',
|
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
package/src/node-types.json
CHANGED
|
@@ -720,6 +720,10 @@
|
|
|
720
720
|
"type": "import_statement",
|
|
721
721
|
"named": true
|
|
722
722
|
},
|
|
723
|
+
{
|
|
724
|
+
"type": "lazy_import_statement",
|
|
725
|
+
"named": true
|
|
726
|
+
},
|
|
723
727
|
{
|
|
724
728
|
"type": "match_statement",
|
|
725
729
|
"named": true
|
|
@@ -2332,6 +2336,25 @@
|
|
|
2332
2336
|
]
|
|
2333
2337
|
}
|
|
2334
2338
|
},
|
|
2339
|
+
{
|
|
2340
|
+
"type": "lazy_import_statement",
|
|
2341
|
+
"named": true,
|
|
2342
|
+
"fields": {},
|
|
2343
|
+
"children": {
|
|
2344
|
+
"multiple": false,
|
|
2345
|
+
"required": true,
|
|
2346
|
+
"types": [
|
|
2347
|
+
{
|
|
2348
|
+
"type": "import_from_statement",
|
|
2349
|
+
"named": true
|
|
2350
|
+
},
|
|
2351
|
+
{
|
|
2352
|
+
"type": "import_statement",
|
|
2353
|
+
"named": true
|
|
2354
|
+
}
|
|
2355
|
+
]
|
|
2356
|
+
}
|
|
2357
|
+
},
|
|
2335
2358
|
{
|
|
2336
2359
|
"type": "list",
|
|
2337
2360
|
"named": true,
|
|
@@ -2580,6 +2603,10 @@
|
|
|
2580
2603
|
"type": "import_statement",
|
|
2581
2604
|
"named": true
|
|
2582
2605
|
},
|
|
2606
|
+
{
|
|
2607
|
+
"type": "lazy_import_statement",
|
|
2608
|
+
"named": true
|
|
2609
|
+
},
|
|
2583
2610
|
{
|
|
2584
2611
|
"type": "match_statement",
|
|
2585
2612
|
"named": true
|
|
@@ -3858,6 +3885,10 @@
|
|
|
3858
3885
|
"type": "lambda",
|
|
3859
3886
|
"named": false
|
|
3860
3887
|
},
|
|
3888
|
+
{
|
|
3889
|
+
"type": "lazy",
|
|
3890
|
+
"named": false
|
|
3891
|
+
},
|
|
3861
3892
|
{
|
|
3862
3893
|
"type": "line_continuation",
|
|
3863
3894
|
"named": true,
|
package/tree-sitter-python.wasm
CHANGED
|
Binary file
|