2020-06-21 20:38:00 +02:00
|
|
|
(function_definition
|
|
|
|
|
body: (block)? @function.inner) @function.outer
|
2020-06-27 18:56:31 +02:00
|
|
|
|
2020-07-15 20:47:26 +02:00
|
|
|
(decorated_definition
|
|
|
|
|
(function_definition) @function.outer) @function.outer.start
|
|
|
|
|
|
2020-06-27 18:56:31 +02:00
|
|
|
(class_definition
|
|
|
|
|
body: (block)? @class.inner) @class.outer
|
|
|
|
|
|
2020-07-15 20:47:26 +02:00
|
|
|
(decorated_definition
|
|
|
|
|
(class_definition) @class.outer) @class.outer.start
|
|
|
|
|
|
2020-06-27 18:56:31 +02:00
|
|
|
(while_statement
|
|
|
|
|
body: (block)? @loop.inner) @loop.outer
|
|
|
|
|
|
|
|
|
|
(for_statement
|
|
|
|
|
body: (block)? @loop.inner) @loop.outer
|
|
|
|
|
|
|
|
|
|
(if_statement
|
2020-07-15 20:47:26 +02:00
|
|
|
alternative: (_ (_) @conditional.inner)?) @conditional.outer
|
|
|
|
|
|
|
|
|
|
(if_statement
|
|
|
|
|
consequence: (block)? @conditional.inner)
|
2020-06-27 18:56:31 +02:00
|
|
|
|
|
|
|
|
(if_statement
|
|
|
|
|
condition: (_) @conditional.inner)
|
|
|
|
|
|
|
|
|
|
(_ (block) @block.inner) @block.outer
|
|
|
|
|
(comment) @comment.outer
|
|
|
|
|
|
|
|
|
|
(block (_) @statement.outer)
|
|
|
|
|
|
|
|
|
|
(call) @call.outer
|
|
|
|
|
(call (_) @call.inner)
|
2020-08-02 18:03:50 -05:00
|
|
|
|
|
|
|
|
;; Parameters
|
|
|
|
|
(parameters
|
|
|
|
|
[(identifier)
|
|
|
|
|
(tuple)
|
|
|
|
|
(typed_parameter)
|
|
|
|
|
(default_parameter)
|
|
|
|
|
(typed_default_parameter)
|
|
|
|
|
(list_splat)
|
|
|
|
|
(dictionary_splat)] @parameter.inner)
|
|
|
|
|
|
|
|
|
|
(lambda_parameters
|
|
|
|
|
[(identifier)
|
|
|
|
|
(tuple)
|
|
|
|
|
(typed_parameter)
|
|
|
|
|
(default_parameter)
|
|
|
|
|
(typed_default_parameter)
|
|
|
|
|
(list_splat)
|
|
|
|
|
(dictionary_splat)] @parameter.inner)
|
|
|
|
|
|
|
|
|
|
; TODO: exclude comments using the future negate syntax from tree-sitter
|
|
|
|
|
(argument_list (_) @parameter.inner)
|