@@ -190,15 +190,21 @@ class RegExpTerm extends RegExpParent {
190190
191191 Location getLocation ( ) { result = re .getLocation ( ) }
192192
193+ pragma [ noinline]
194+ private predicate componentHasLocationInfo (
195+ int i , string filepath , int startline , int startcolumn , int endline , int endcolumn
196+ ) {
197+ re .getComponent ( i )
198+ .getLocation ( )
199+ .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
200+ }
201+
193202 predicate hasLocationInfo (
194203 string filepath , int startline , int startcolumn , int endline , int endcolumn
195204 ) {
196205 exists ( int re_start , int re_end |
197- re .getComponent ( 0 ) .getLocation ( ) .hasLocationInfo ( filepath , startline , re_start , _, _) and
198- re .getComponent ( re .getNumberOfComponents ( ) - 1 )
199- .getLocation ( )
200- .hasLocationInfo ( filepath , _, _, endline , re_end )
201- |
206+ this .componentHasLocationInfo ( 0 , filepath , startline , re_start , _, _) and
207+ this .componentHasLocationInfo ( re .getNumberOfComponents ( ) - 1 , filepath , _, _, endline , re_end ) and
202208 startcolumn = re_start + start and
203209 endcolumn = re_start + end - 1
204210 )
0 commit comments