File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed
Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ class ErbDirective extends TDirectiveNode, ErbAstNode {
159159 */
160160 Stmt getAChildStmt ( ) {
161161 this .containsStmtStart ( result ) and
162- not this .containsStmtStart ( result .getParent ( ) )
162+ not this .containsStmtStart ( parent * ( result ) .getParent ( ) )
163163 }
164164
165165 /**
@@ -183,6 +183,11 @@ class ErbDirective extends TDirectiveNode, ErbAstNode {
183183 override string getAPrimaryQlClass ( ) { result = "ErbDirective" }
184184}
185185
186+ private AstNode parent ( AstNode n ) {
187+ result = n .getParent ( ) and
188+ not result instanceof Stmt
189+ }
190+
186191/**
187192 * A comment directive in an ERB template.
188193 * ```erb
Original file line number Diff line number Diff line change @@ -28,14 +28,12 @@ deprecated class Pattern extends AstNode {
2828 Variable getAVariable ( ) { none ( ) }
2929}
3030
31- deprecated private class TVariablePattern = TVariableAccess or TSimpleParameter ;
32-
3331/**
3432 * DEPRECATED
3533 *
3634 * A simple variable pattern.
3735 */
38- deprecated class VariablePattern extends Pattern , LhsExpr , TVariablePattern {
36+ deprecated class VariablePattern extends Pattern , LhsExpr , TVariableAccess {
3937 override Variable getAVariable ( ) { result = this .( VariableAccess ) .getVariable ( ) }
4038}
4139
Original file line number Diff line number Diff line change @@ -660,7 +660,7 @@ class TExpr =
660660 TSelf or TArgumentList or TInClause or TRescueClause or TRescueModifierExpr or TPair or
661661 TStringConcatenation or TCall or TBlockArgument or TConstantAccess or TControlExpr or
662662 TWhenExpr or TLiteral or TCallable or TVariableAccess or TStmtSequence or TOperation or
663- TSimpleParameter or TForwardArgument or TDestructuredLhsExpr ;
663+ TForwardArgument or TDestructuredLhsExpr ;
664664
665665class TSplatExpr = TSplatExprReal or TSplatExprSynth ;
666666
Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ private module Shared {
227227 isHelperMethod ( helperMethod , name , template ) and
228228 isMethodCall ( helperMethodCall .getExpr ( ) , name , template ) and
229229 helperMethodCall .getArgument ( pragma [ only_bind_into ] ( argIdx ) ) = node1 .asExpr ( ) and
230- helperMethod .getParameter ( pragma [ only_bind_into ] ( argIdx ) ) = node2 .asExpr ( ) . getExpr ( )
230+ helperMethod .getParameter ( pragma [ only_bind_into ] ( argIdx ) ) = node2 .asParameter ( )
231231 )
232232 }
233233
You can’t perform that action at this time.
0 commit comments