@@ -118,7 +118,7 @@ private class ErbDirectiveFile extends File {
118
118
119
119
/** Gets a statement in this file. */
120
120
pragma [ nomagic]
121
- Stmt getAStmt ( int startLine , int startColumn ) {
121
+ AstNode getAnAstNode ( int startLine , int startColumn ) {
122
122
exists ( Location loc |
123
123
result .getLocation ( ) = loc and
124
124
loc .getFile ( ) = this and
@@ -142,13 +142,13 @@ class ErbDirective extends TDirectiveNode, ErbAstNode {
142
142
)
143
143
}
144
144
145
- private predicate containsStmtStart ( Stmt s ) {
145
+ private predicate containsAstNodeStart ( AstNode s ) {
146
146
// `Toplevel` statements are not contained within individual directives,
147
147
// though their start location may appear within a directive location
148
148
not s instanceof Toplevel and
149
149
exists ( ErbDirectiveFile file , int startLine , int startColumn |
150
150
this .spans ( file , startLine ) and
151
- s = file .getAStmt ( startLine , startColumn ) and
151
+ s = file .getAnAstNode ( startLine , startColumn ) and
152
152
locationIncludesPosition ( this .getLocation ( ) , startLine , startColumn )
153
153
)
154
154
}
@@ -158,8 +158,8 @@ class ErbDirective extends TDirectiveNode, ErbAstNode {
158
158
* statement starting in this directive.
159
159
*/
160
160
Stmt getAChildStmt ( ) {
161
- this .containsStmtStart ( result ) and
162
- not this .containsStmtStart ( parent * ( result ) .getParent ( ) )
161
+ this .containsAstNodeStart ( result ) and
162
+ not this .containsAstNodeStart ( result .getParent ( ) )
163
163
}
164
164
165
165
/**
@@ -183,11 +183,6 @@ 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
-
191
186
/**
192
187
* A comment directive in an ERB template.
193
188
* ```erb
0 commit comments