2020-12-16 09:42:48 -08:00
|
|
|
[
|
2020-12-20 12:42:11 +01:00
|
|
|
(list)
|
|
|
|
|
(dictionary)
|
|
|
|
|
(set)
|
|
|
|
|
|
|
|
|
|
(import_from_statement)
|
|
|
|
|
|
|
|
|
|
(parenthesized_expression)
|
|
|
|
|
(generator_expression)
|
|
|
|
|
(list_comprehension)
|
|
|
|
|
(set_comprehension)
|
|
|
|
|
(dictionary_comprehension)
|
|
|
|
|
|
|
|
|
|
(tuple_pattern)
|
|
|
|
|
(list_pattern)
|
|
|
|
|
(binary_operator)
|
|
|
|
|
|
2022-01-18 21:17:26 +06:00
|
|
|
(lambda)
|
|
|
|
|
|
|
|
|
|
(concatenated_string)
|
2020-12-16 09:42:48 -08:00
|
|
|
] @indent
|
2023-03-14 12:25:38 -07:00
|
|
|
|
|
|
|
|
((for_statement) @indent
|
|
|
|
|
(#set! "immediate_indent" 1))
|
|
|
|
|
((if_statement) @indent
|
|
|
|
|
(#set! "immediate_indent" 1))
|
|
|
|
|
((while_statement) @indent
|
|
|
|
|
(#set! "immediate_indent" 1))
|
|
|
|
|
((try_statement) @indent
|
|
|
|
|
(#set! "immediate_indent" 1))
|
|
|
|
|
((ERROR "try" ":") @indent
|
|
|
|
|
(#set! "immediate_indent" 1))
|
|
|
|
|
((function_definition) @indent
|
|
|
|
|
(#set! "immediate_indent" 1))
|
|
|
|
|
((class_definition) @indent
|
|
|
|
|
(#set! "immediate_indent" 1))
|
|
|
|
|
((with_statement) @indent
|
|
|
|
|
(#set! "immediate_indent" 1))
|
|
|
|
|
|
2022-01-19 03:06:06 +06:00
|
|
|
(if_statement
|
|
|
|
|
condition: (parenthesized_expression) @aligned_indent
|
|
|
|
|
(#set! "delimiter" "()")
|
2023-03-14 12:25:38 -07:00
|
|
|
(#set! "final_line_indent" 1) ; parenthesized_expression already indented
|
|
|
|
|
)
|
|
|
|
|
(while_statement
|
|
|
|
|
condition: (parenthesized_expression) @aligned_indent
|
|
|
|
|
(#set! "delimiter" "()")
|
|
|
|
|
(#set! "final_line_indent" 1) ; parenthesized_expression already indented
|
2022-01-19 03:06:06 +06:00
|
|
|
)
|
2023-03-14 12:25:38 -07:00
|
|
|
|
2022-01-22 14:50:51 +01:00
|
|
|
((ERROR "(" . (_)) @aligned_indent
|
|
|
|
|
(#set! "delimiter" "()"))
|
2022-01-19 03:06:06 +06:00
|
|
|
((argument_list) @aligned_indent
|
|
|
|
|
(#set! "delimiter" "()"))
|
|
|
|
|
((parameters) @aligned_indent
|
2023-03-14 12:25:38 -07:00
|
|
|
(#set! "delimiter" "()")
|
|
|
|
|
(#set! "final_line_indent" 1))
|
2022-01-19 03:06:06 +06:00
|
|
|
((tuple) @aligned_indent
|
|
|
|
|
(#set! "delimiter" "()"))
|
|
|
|
|
|
2020-12-16 09:42:48 -08:00
|
|
|
[
|
2020-12-20 12:42:11 +01:00
|
|
|
")"
|
|
|
|
|
"]"
|
|
|
|
|
"}"
|
|
|
|
|
(elif_clause)
|
|
|
|
|
(else_clause)
|
|
|
|
|
(except_clause)
|
|
|
|
|
(finally_clause)
|
2020-12-16 09:42:48 -08:00
|
|
|
] @branch
|
2021-01-08 00:33:15 +01:00
|
|
|
|
2022-01-18 21:17:26 +06:00
|
|
|
(string) @auto
|