tree-sitter-tiger/queries/textobjects.scm

44 lines
977 B
Scheme
Raw Normal View History

2022-06-04 22:02:34 +02:00
; Functions and methods {{{
2022-06-04 10:32:13 +02:00
(function_declaration
2022-06-04 10:37:59 +02:00
parameters: ((_) @parameter.inner)* @parameter.outer
2022-06-04 10:32:13 +02:00
body: (_) @function.inner) @function.outer
2022-06-04 10:37:59 +02:00
(primitive_declaration
parameters: ((_) @parameter.inner)* @parameter.outer) @function.outer
2022-06-04 10:32:35 +02:00
2022-06-04 22:02:34 +02:00
(method_declaration
parameters: ((_) @parameter.inner)* @parameter.outer
body: (_) @function.inner) @function.outer
2022-06-04 10:32:35 +02:00
(function_call
arguments: ((_) @call.inner)*) @call.outer
2022-06-04 22:02:34 +02:00
(method_call
arguments: ((_) @call.inner)*) @call.outer
2022-06-04 10:32:13 +02:00
; }}}
2022-06-04 10:46:04 +02:00
; Control flow {{{
(if_expression
consequence: (_) @conditional.inner
alternative: (_)? @conditional.inner) @conditional.outer
2022-06-04 10:47:19 +02:00
(while_expression
body: (_) @loop.inner) @loop.outer
(for_expression
body: (_) @loop.inner) @loop.outer
2022-06-04 10:46:04 +02:00
; }}}
2022-06-04 22:00:03 +02:00
; Class {{{
(class_declaration
fields: (_)* @class.inner) @class.outer
2022-11-22 10:05:37 +01:00
(type_declaration
(class_type
fields: (_)* @class.inner)) @class.outer
2022-06-04 22:00:03 +02:00
; }}}
; Misc {{{
(comment) @comment.outer
; }}}
; vim: sw=2 foldmethod=marker