-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathruby.scm
97 lines (82 loc) · 1.48 KB
/
ruby.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
;; https://github.com/tree-sitter/tree-sitter-ruby/blob/master/src/grammar.json
(comment) @comment @textFragment
(hash) @map
(regex) @regularExpression
(call) @functionCall
[
(array)
(string_array)
(symbol_array)
] @list
(_
(if) @ifStatement
) @_.iteration
[
(method)
(singleton_method)
] @namedFunction
(class) @class
(class) @namedFunction.iteration @class.iteration
(program) @namedFunction.iteration @class.iteration @className.iteration
(class) @functionName.iteration @name.iteration
(program) @functionName.iteration @name.iteration
(class
name: (_) @className @name
) @_.domain
(string) @string
[
(string_content)
(heredoc_content)
] @textFragment
(method
name: (_) @functionName @name
) @_.domain
(singleton_method
name: (_) @functionName @name
) @_.domain
(assignment
left: (_) @name
) @_.domain
(operator_assignment
left: (_) @name
) @_.domain
operator: [
"<"
"<<"
"<<="
"<="
">"
">="
">>"
">>="
] @disqualifyDelimiter
(pair
"=>" @disqualifyDelimiter
)
(match_pattern
"=>" @disqualifyDelimiter
)
;;!! %w(foo bar)
;;! ^^^ ^^^
(
(string_array
(bare_string)? @_.leading.endOf
.
(bare_string) @collectionItem
.
(bare_string)? @_.trailing.startOf
)
(#insertion-delimiter! @collectionItem " ")
)
;;!! %i(foo bar)
;;! ^^^ ^^^
(
(symbol_array
(bare_symbol)? @_.leading.endOf
.
(bare_symbol) @collectionItem
.
(bare_symbol)? @_.trailing.startOf
)
(#insertion-delimiter! @collectionItem " ")
)