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 {
159
159
*/
160
160
Stmt getAChildStmt ( ) {
161
161
this .containsStmtStart ( result ) and
162
- not this .containsStmtStart ( result .getParent ( ) )
162
+ not this .containsStmtStart ( parent * ( result ) .getParent ( ) )
163
163
}
164
164
165
165
/**
@@ -183,6 +183,11 @@ class ErbDirective extends TDirectiveNode, ErbAstNode {
183
183
override string getAPrimaryQlClass ( ) { result = "ErbDirective" }
184
184
}
185
185
186
+ private AstNode parent ( AstNode n ) {
187
+ result = n .getParent ( ) and
188
+ not result instanceof Stmt
189
+ }
190
+
186
191
/**
187
192
* A comment directive in an ERB template.
188
193
* ```erb
Original file line number Diff line number Diff line change @@ -28,14 +28,12 @@ deprecated class Pattern extends AstNode {
28
28
Variable getAVariable ( ) { none ( ) }
29
29
}
30
30
31
- deprecated private class TVariablePattern = TVariableAccess or TSimpleParameter ;
32
-
33
31
/**
34
32
* DEPRECATED
35
33
*
36
34
* A simple variable pattern.
37
35
*/
38
- deprecated class VariablePattern extends Pattern , LhsExpr , TVariablePattern {
36
+ deprecated class VariablePattern extends Pattern , LhsExpr , TVariableAccess {
39
37
override Variable getAVariable ( ) { result = this .( VariableAccess ) .getVariable ( ) }
40
38
}
41
39
Original file line number Diff line number Diff line change @@ -660,7 +660,7 @@ class TExpr =
660
660
TSelf or TArgumentList or TInClause or TRescueClause or TRescueModifierExpr or TPair or
661
661
TStringConcatenation or TCall or TBlockArgument or TConstantAccess or TControlExpr or
662
662
TWhenExpr or TLiteral or TCallable or TVariableAccess or TStmtSequence or TOperation or
663
- TSimpleParameter or TForwardArgument or TDestructuredLhsExpr ;
663
+ TForwardArgument or TDestructuredLhsExpr ;
664
664
665
665
class TSplatExpr = TSplatExprReal or TSplatExprSynth ;
666
666
Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ private module Shared {
227
227
isHelperMethod ( helperMethod , name , template ) and
228
228
isMethodCall ( helperMethodCall .getExpr ( ) , name , template ) and
229
229
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 ( )
231
231
)
232
232
}
233
233
You can’t perform that action at this time.
0 commit comments