@@ -20,7 +20,7 @@ def uses_method_chain?
20
20
} ,
21
21
{
22
22
method_name : :tr ,
23
- receiver : s ( :lvar , :words ) ,
23
+ receiver : ArbitraryLvar . new ,
24
24
chained? : true ,
25
25
arguments : [ { to_ast : s ( :str , "-" ) } , { to_ast : s ( :str , " " ) } ]
26
26
}
@@ -53,7 +53,7 @@ def uses_method_chain_with_block?
53
53
} ,
54
54
{
55
55
method_name : :tr ,
56
- receiver : s ( :lvar , :words ) ,
56
+ receiver : ArbitraryLvar . new ,
57
57
chained? : true ,
58
58
arguments : [ { to_ast : s ( :str , "-" ) } , { to_ast : s ( :str , " " ) } ]
59
59
} ,
@@ -77,7 +77,7 @@ def uses_scan?
77
77
} ,
78
78
{
79
79
method_name : :scan ,
80
- receiver : s ( :lvar , :words ) ,
80
+ receiver : ArbitraryLvar . new ,
81
81
chained? : true ,
82
82
arguments : [ { type : :regexp } ]
83
83
} ,
@@ -102,7 +102,7 @@ def uses_split?
102
102
} ,
103
103
{
104
104
method_name : :split ,
105
- receiver : s ( :lvar , :words ) ,
105
+ receiver : ArbitraryLvar . new ,
106
106
arguments : [ { type : :regexp } ]
107
107
}
108
108
]
@@ -140,9 +140,15 @@ def node_matches?(node, matcher)
140
140
node_matches? ( n , expected_value [ i ] )
141
141
end
142
142
else
143
- criteria_value == expected_value
143
+ expected_value == criteria_value
144
144
end
145
145
end
146
146
end
147
147
end
148
148
end
149
+
150
+ class ArbitraryLvar
151
+ def ==( other )
152
+ other . type == :lvar
153
+ end
154
+ end
0 commit comments