1
2(
3 (mod_item
4 name: (_) @run
5 (#eq? @run "tests")
6 )
7 (#set! tag rust-mod-test)
8)
9
10(
11 (
12 (attribute_item (attribute
13 [((identifier) @_attribute)
14 (scoped_identifier (identifier) @_attribute)
15 ])
16 (#match? @_attribute "test")
17 ) @_start
18 .
19 (attribute_item) *
20 .
21 (function_item
22 name: (_) @run
23 body: _
24 ) @_end
25 )
26 (#set! tag rust-test)
27)
28
29; Rust main function
30(
31 (
32 (function_item
33 name: (_) @run
34 body: _
35 ) @_rust_main_function_end
36 (#eq? @run "main")
37 )
38 (#set! tag rust-main)
39)