@@ -194,16 +194,22 @@ class RegExpTerm extends RegExpParent {
194194 */
195195 Location getLocation ( ) { result = re .getLocation ( ) }
196196
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+
197206 /** Holds if this term is found at the specified location offsets. */
198207 predicate hasLocationInfo (
199208 string filepath , int startline , int startcolumn , int endline , int endcolumn
200209 ) {
201210 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
207213 startcolumn = re_start + start and
208214 endcolumn = re_start + end - 1
209215 )
0 commit comments