aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--queries/swift/folds.scm35
1 files changed, 35 insertions, 0 deletions
diff --git a/queries/swift/folds.scm b/queries/swift/folds.scm
new file mode 100644
index 000000000..cfbc6d0b1
--- /dev/null
+++ b/queries/swift/folds.scm
@@ -0,0 +1,35 @@
+; format-ignore
+[
+ (protocol_body) ; protocol Foo { ... }
+ (class_body) ; class Foo { ... }
+ (enum_class_body) ; enum Foo { ... }
+ (function_body) ; func Foo (...) {...}
+ (computed_property) ; { ... }
+
+ (computed_getter) ; get { ... }
+ (computed_setter) ; set { ... }
+
+ (do_statement)
+ (if_statement)
+ (for_statement)
+ (switch_statement)
+ (while_statement)
+ (guard_statement)
+ (switch_entry)
+
+ (type_parameters) ; x<Foo>
+ (tuple_type) ; (...)
+ (array_type) ; [String]
+ (dictionary_type) ; [Foo: Bar]
+
+ (call_expression) ; callFunc(...)
+ (tuple_expression) ; ( foo + bar )
+ (array_literal) ; [ foo, bar ]
+ (dictionary_literal) ; [ foo: bar, x: y ]
+ (lambda_literal)
+ (willset_didset_block)
+ (willset_clause)
+ (didset_clause)
+
+ (import_declaration)+
+] @fold