add hasLocationInfo predicate to regexp terms

This commit is contained in:
erik-krogh
2022-11-01 10:18:07 +01:00
parent e928777cb7
commit 4a2472a078

View File

@@ -176,6 +176,13 @@ class RegExpTerm extends Locatable, @regexpterm {
* Gets a string that is matched by this regular-expression term.
*/
string getAMatchedString() { result = this.getConstantValue() }
/** Holds if this term has the specified location. */
predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
}
}
/**