summaryrefslogtreecommitdiff
path: root/queries
diff options
context:
space:
mode:
authorSantos Gallegos <stsewd@protonmail.com>2020-09-03 11:09:57 -0500
committerThomas Vigouroux <tomvig38@gmail.com>2020-09-03 18:14:28 +0200
commitbdf43b15df799ae12fadd4eb214e13704454dd98 (patch)
tree31f9c03ab6307fc5b20fc1902bd84d4ea95ab427 /queries
parent38df2d252faa1293aa0dfa0f1c73eb31a16e9d9f (diff)
Python: add folds
Diffstat (limited to 'queries')
-rw-r--r--queries/python/fold.scm24
1 files changed, 24 insertions, 0 deletions
diff --git a/queries/python/fold.scm b/queries/python/fold.scm
new file mode 100644
index 00000000..22e03b42
--- /dev/null
+++ b/queries/python/fold.scm
@@ -0,0 +1,24 @@
+(function_definition (block) @fold)
+(class_definition (block) @fold)
+
+(while_statement (block) @fold)
+(for_statement (block) @fold)
+(if_statement (block) @fold)
+(with_statement (block) @fold)
+(try_statement (block) @fold)
+
+[
+ (import_from_statement)
+ (parameters)
+
+ (parenthesized_expression)
+ (generator_expression)
+ (list_comprehension)
+ (set_comprehension)
+ (dictionary_comprehension)
+
+ (tuple)
+ (list)
+ (set)
+ (dictionary)
+] @fold