Swift: We don't need the location components logic inRegExpTerm, at least, not yet.

This commit is contained in:
Geoffrey White
2023-06-20 15:42:37 +01:00
parent e127030b5c
commit 5a99007ab1

View File

@@ -207,30 +207,10 @@ private module Impl implements RegexTreeViewSig {
*/
Location getLocation() { result = re.getLocation() }
/*
* pragma[noinline]
* private predicate componentHasLocationInfo(
* int i, string filepath, int startline, int startcolumn, int endline, int endcolumn
* ) {
* re.getComponent(i)
* .getLocation()
* .hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
* }
*/
/** Holds if this term is found at the specified location offsets. */
predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
/*
* exists(int re_start |
* this.componentHasLocationInfo(0, filepath, startline, re_start, _, _) and
* this.componentHasLocationInfo(re.getNumberOfComponents() - 1, filepath, _, _, endline, _) and
* startcolumn = re_start + start and
* endcolumn = re_start + end - 1
* )
*/
filepath = re.getFile().getAbsolutePath() and
startline = re.getLocation().getStartLine() and
startcolumn = re.getLocation().getStartColumn() and