@@ -120,9 +120,15 @@ private module Cached {
120120 THashSplatParameter ( Generated:: HashSplatParameter g ) or
121121 THereDoc ( Generated:: HeredocBeginning g ) or
122122 TIdentifierMethodCall ( Generated:: Identifier g ) { vcall ( g ) and not access ( g , _) } or
123- TIdentifierMethodCallImplicitSelf ( Generated:: Identifier g ) { vcall ( g ) and not access ( g , _) } or
124123 TIf ( Generated:: If g ) or
125124 TIfModifierExpr ( Generated:: IfModifier g ) or
125+ TImplicitSelf ( Generated:: AstNode g ) {
126+ exists ( TIdentifierMethodCall ( g ) )
127+ or
128+ exists ( TRegularMethodCall ( g ) ) and
129+ not exists ( g .( Generated:: Call ) .getReceiver ( ) ) and
130+ not exists ( g .( Generated:: Call ) .getMethod ( ) .( Generated:: ScopeResolution ) .getScope ( ) )
131+ } or
126132 TInstanceVariableAccess ( Generated:: InstanceVariable g , AST:: InstanceVariable v ) {
127133 InstanceVariableAccess:: range ( g , v )
128134 } or
@@ -160,11 +166,6 @@ private module Cached {
160166 TRegexMatchExpr ( Generated:: Binary g ) { g instanceof @binary_equaltilde } or
161167 TRegularArrayLiteral ( Generated:: Array g ) or
162168 TRegularMethodCall ( Generated:: Call g ) { not g .getMethod ( ) instanceof Generated:: Super } or
163- TRegularMethodCallImplicitSelf ( Generated:: Call g ) {
164- not g .getMethod ( ) instanceof Generated:: Super and
165- not exists ( g .getReceiver ( ) ) and
166- not exists ( g .getMethod ( ) .( Generated:: ScopeResolution ) .getScope ( ) )
167- } or
168169 TRegularStringLiteral ( Generated:: String g ) or
169170 TRegularSuperCall ( Generated:: Call g ) { g .getMethod ( ) instanceof Generated:: Super } or
170171 TRescueClause ( Generated:: Rescue g ) or
@@ -383,8 +384,7 @@ private module Cached {
383384 cached
384385 Generated:: AstNode toGeneratedInclSynth ( AST:: AstNode n ) {
385386 result = toGenerated ( n ) or
386- n = TIdentifierMethodCallImplicitSelf ( result ) or
387- n = TRegularMethodCallImplicitSelf ( result )
387+ n = TImplicitSelf ( result )
388388 }
389389}
390390
@@ -413,7 +413,7 @@ class TConditionalLoop = TWhileExpr or TUntilExpr or TWhileModifierExpr or TUnti
413413
414414class TLoop = TConditionalLoop or TForExpr ;
415415
416- class TSelf = TExplicitSelf or TIdentifierMethodCallImplicitSelf or TRegularMethodCallImplicitSelf ;
416+ class TSelf = TExplicitSelf or TImplicitSelf ;
417417
418418class TExpr =
419419 TSelf or TArgumentList or TRescueClause or TRescueModifierExpr or TPair or TStringConcatenation or
0 commit comments