Python: Document a bunch of hasLocationInfo methods.

If only we had been _somewhat consistent in how we named the
parameters for these...
This commit is contained in:
Taus Brock-Nannestad
2020-06-24 22:38:03 +02:00
parent 682e1b6040
commit fe78e68fd0
11 changed files with 206 additions and 60 deletions

View File

@@ -468,7 +468,13 @@ Definition getUniqueDefinition(Expr use) {
/** Helper class to get suitable locations for attributes */
class NiceLocationExpr extends @py_expr {
string toString() { result = this.(Expr).toString() }
/**
* Holds if this element is at the specified location.
* The location spans column `bc` of line `bl` to
* column `ec` of line `el` in file `f`.
* For more information, see
* [Locations](https://help.semmle.com/QL/learn-ql/ql/locations.html).
*/
predicate hasLocationInfo(string f, int bl, int bc, int el, int ec) {
/* Attribute location for x.y is that of 'y' so that url does not overlap with that of 'x' */
exists(int abl, int abc | this.(Attribute).getLocation().hasLocationInfo(f, abl, abc, el, ec) |