@@ -194,16 +194,22 @@ class RegExpTerm extends RegExpParent {
194
194
*/
195
195
Location getLocation ( ) { result = re .getLocation ( ) }
196
196
197
+ pragma [ noinline]
198
+ private predicate componentHasLocationInfo (
199
+ int i , string filepath , int startline , int startcolumn , int endline , int endcolumn
200
+ ) {
201
+ re .getComponent ( i )
202
+ .getLocation ( )
203
+ .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
204
+ }
205
+
197
206
/** Holds if this term is found at the specified location offsets. */
198
207
predicate hasLocationInfo (
199
208
string filepath , int startline , int startcolumn , int endline , int endcolumn
200
209
) {
201
210
exists ( int re_start , int re_end |
202
- re .getComponent ( 0 ) .getLocation ( ) .hasLocationInfo ( filepath , startline , re_start , _, _) and
203
- re .getComponent ( re .getNumberOfComponents ( ) - 1 )
204
- .getLocation ( )
205
- .hasLocationInfo ( filepath , _, _, endline , re_end )
206
- |
211
+ this .componentHasLocationInfo ( 0 , filepath , startline , re_start , _, _) and
212
+ this .componentHasLocationInfo ( re .getNumberOfComponents ( ) - 1 , filepath , _, _, endline , re_end ) and
207
213
startcolumn = re_start + start and
208
214
endcolumn = re_start + end - 1
209
215
)
0 commit comments