-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathscm.name.scm
83 lines (79 loc) · 1.62 KB
/
scm.name.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
;;!! (aaa) @bbb @ccc
;;! ^^^^^^^^^
;;! ---------------
(
(_
_ @_dummy
.
(capture) @name.start
(capture)? @name.end
.
) @_.domain
(#not-type? @_.domain parameters)
(#not-type? @_dummy capture)
(#not-parent-type? @_.domain field_definition)
)
;;!! eee: (aaa) @bbb @ccc
;;! ^^^^^^^^^
;;! --------------------
(
(field_definition
(_
_ @_dummy
.
(capture) @name.start
(capture)? @name.end
.
)
) @_.domain
(#not-type? @_dummy capture)
)
;;!! (aaa) @bbb @ccc
;;! ^^^^ ^^^^
(
(_
(capture) @name
) @_dummy
(#not-type? @_dummy parameters)
(#has-multiple-children-of-type? @_dummy capture)
)
;;!! (aaa) @bbb @ccc
;;! *********
;;! --------------- <~ iteration domain
(
(_
_ @_dummy
.
(capture) @name.iteration.start
) @name.iteration.end.endOf @name.iteration.domain
(#not-type? @_dummy capture)
(#not-type? @name.iteration.start parameters)
(#not-parent-type? @name.iteration.domain field_definition)
)
;;!! ddd: (aaa) @bbb @ccc
;;! *********
;;! -------------------- <~ iteration domain
(
(field_definition
[
;; Note that we can't use wildcard node due to
;; https://github.com/tree-sitter/tree-sitter/issues/2483
(named_node
_ @_dummy
.
(capture) @name.iteration.start
)
(anonymous_node
_ @_dummy
.
(capture) @name.iteration.start
)
(list
_ @_dummy
.
(capture) @name.iteration.start
)
]
) @name.iteration.end.endOf @name.iteration.domain
(#not-type? @_dummy capture)
)