@@ -10,8 +10,21 @@ class File extends Container {
1010 /** DEPRECATED: Use `getAbsolutePath` instead. */
1111 deprecated string getFullName ( ) { result = this .getAbsolutePath ( ) }
1212
13- predicate hasLocationInfo ( string filepath , int bl , int bc , int el , int ec ) {
14- this .getAbsolutePath ( ) = filepath and bl = 0 and bc = 0 and el = 0 and ec = 0
13+ /**
14+ * Holds if this element is at the specified location.
15+ * The location spans column `startcolumn` of line `startline` to
16+ * column `endcolumn` of line `endline` in file `filepath`.
17+ * For more information, see
18+ * [Locations](https://help.semmle.com/QL/learn-ql/ql/locations.html).
19+ */
20+ predicate hasLocationInfo (
21+ string filepath , int startline , int startcolumn , int endline , int endcolumn
22+ ) {
23+ this .getAbsolutePath ( ) = filepath and
24+ startline = 0 and
25+ startcolumn = 0 and
26+ endline = 0 and
27+ endcolumn = 0
1528 }
1629
1730 /** Whether this file is a source code file. */
@@ -79,8 +92,21 @@ class Folder extends Container {
7992 /** DEPRECATED: Use `getBaseName` instead. */
8093 deprecated string getSimple ( ) { folders ( this , _, result ) }
8194
82- predicate hasLocationInfo ( string filepath , int bl , int bc , int el , int ec ) {
83- this .getAbsolutePath ( ) = filepath and bl = 0 and bc = 0 and el = 0 and ec = 0
95+ /**
96+ * Holds if this element is at the specified location.
97+ * The location spans column `startcolumn` of line `startline` to
98+ * column `endcolumn` of line `endline` in file `filepath`.
99+ * For more information, see
100+ * [Locations](https://help.semmle.com/QL/learn-ql/ql/locations.html).
101+ */
102+ predicate hasLocationInfo (
103+ string filepath , int startline , int startcolumn , int endline , int endcolumn
104+ ) {
105+ this .getAbsolutePath ( ) = filepath and
106+ startline = 0 and
107+ startcolumn = 0 and
108+ endline = 0 and
109+ endcolumn = 0
84110 }
85111
86112 override string getAbsolutePath ( ) { folders ( this , result , _) }
@@ -371,23 +397,39 @@ class Location extends @location {
371397 result = this .getPath ( ) .getAbsolutePath ( ) + ":" + this .getStartLine ( ) .toString ( )
372398 }
373399
374- predicate hasLocationInfo ( string filepath , int bl , int bc , int el , int ec ) {
375- exists ( File f | f .getAbsolutePath ( ) = filepath |
376- locations_default ( this , f , bl , bc , el , ec )
400+ /**
401+ * Holds if this element is at the specified location.
402+ * The location spans column `startcolumn` of line `startline` to
403+ * column `endcolumn` of line `endline` in file `filepath`.
404+ * For more information, see
405+ * [Locations](https://help.semmle.com/QL/learn-ql/ql/locations.html).
406+ */
407+ predicate hasLocationInfo (
408+ string filepath , int startline , int startcolumn , int endline , int endcolumn
409+ ) { exists ( File f | f .getAbsolutePath ( ) = filepath |
410+ locations_default ( this , f , startline , startcolumn , endline , endcolumn )
377411 or
378- exists ( Module m | m .getFile ( ) = f | locations_ast ( this , m , bl , bc , el , ec ) )
412+ exists ( Module m | m .getFile ( ) = f | locations_ast ( this , m , startline , startcolumn , endline , endcolumn ) )
379413 )
380414 }
381415}
382416
383417/** A non-empty line in the source code */
384418class Line extends @py_line {
385- predicate hasLocationInfo ( string filepath , int bl , int bc , int el , int ec ) {
386- exists ( Module m |
419+ /**
420+ * Holds if this element is at the specified location.
421+ * The location spans column `startcolumn` of line `startline` to
422+ * column `endcolumn` of line `endline` in file `filepath`.
423+ * For more information, see
424+ * [Locations](https://help.semmle.com/QL/learn-ql/ql/locations.html).
425+ */
426+ predicate hasLocationInfo (
427+ string filepath , int startline , int startcolumn , int endline , int endcolumn
428+ ) { exists ( Module m |
387429 m .getFile ( ) .getAbsolutePath ( ) = filepath and
388- el = bl and
389- bc = 1 and
390- py_line_lengths ( this , m , bl , ec )
430+ endline = startline and
431+ startcolumn = 1 and
432+ py_line_lengths ( this , m , startline , endcolumn )
391433 )
392434 }
393435
0 commit comments