Rust: add Locatable::fromSource

This commit is contained in:
Arthur Baars
2025-03-11 12:32:56 +01:00
parent 9814aef71f
commit 66ab3a8002
10 changed files with 12 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
import rust
from Function f
where exists(f.getLocation().getFile().getRelativePath())
where f.fromSource()
select f

View File

@@ -1,5 +1,5 @@
import rust
from Function f
where exists(f.getLocation().getFile().getRelativePath())
where f.fromSource()
select f

View File

@@ -1,5 +1,5 @@
import rust
from Function f
where exists(f.getLocation().getFile().getRelativePath())
where f.fromSource()
select f

View File

@@ -1,5 +1,5 @@
import rust
from Function f
where exists(f.getLocation().getFile().getRelativePath())
where f.fromSource()
select f

View File

@@ -1,5 +1,5 @@
import rust
from Function f
where exists(f.getLocation().getFile().getRelativePath())
where f.fromSource()
select f

View File

@@ -1,5 +1,5 @@
import rust
from Function f
where exists(f.getLocation().getFile().getRelativePath())
where f.fromSource()
select f

View File

@@ -1,5 +1,5 @@
import rust
from Function f
where exists(f.getLocation().getFile().getRelativePath())
where f.fromSource()
select f

View File

@@ -1,5 +1,5 @@
import rust
from Function f
where exists(f.getLocation().getFile().getRelativePath())
where f.fromSource()
select f

View File

@@ -1,5 +1,5 @@
import rust
from Function f
where exists(f.getLocation().getFile().getRelativePath())
where f.fromSource()
select f

View File

@@ -41,6 +41,9 @@ module Impl {
* Gets the primary file where this element occurs.
*/
File getFile() { result = this.getLocation().getFile() }
/** Holds if this element is from source code. */
predicate fromSource() { exists(this.getFile().getRelativePath()) }
}
/** Gets the non-synthesized location of `l`, if any. */