Skip to content

Commit f9d500b

Browse files
authored
fix(ruby): adjust capture predicates (#339)
Replaces the `#match?` predicate where the `#any-of?` or `#eq?` predicates would suffice
1 parent 1a2774c commit f9d500b

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎languages/ruby/highlights.scm‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
] @keyword
5858

5959
((identifier) @keyword
60-
(#match? @keyword "^(private|protected|public)$"))
60+
(#any-of? @keyword "private" "protected" "public"))
6161

6262
; Function calls
6363
(call
@@ -129,7 +129,7 @@
129129

130130
; Identifiers
131131
((identifier) @constant.builtin
132-
(#match? @constant.builtin "^__(FILE|LINE|ENCODING)__$"))
132+
(#any-of? @constant.builtin "__FILE__" "__LINE__" "__ENCODING__"))
133133

134134
(file) @constant.builtin
135135

‎languages/ruby/textobjects.scm‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
(call
1111
receiver: (constant) @_class_const
1212
method: (identifier) @_class_method
13-
(#match? @_class_const "Class")
14-
(#match? @_class_method "new")
13+
(#eq? @_class_const "Class")
14+
(#eq? @_class_method "new")
1515
(do_block
1616
(_)+ @class.inside)) @class.around
1717

0 commit comments

Comments
 (0)