C++: Factor out file encoding predicate

This commit is contained in:
Jason Reed
2020-04-29 09:53:13 -04:00
parent 0500715bc1
commit e73833eda6
3 changed files with 3 additions and 6 deletions

View File

@@ -214,3 +214,6 @@ Top definitionOf(Top e, string kind) {
// later on.
strictcount(result.getLocation()) < 10
}
cached
File getEncodedFile(string name) { result.getAbsolutePath().replaceAll(":", "_") = name }

View File

@@ -11,9 +11,6 @@ import definitions
external string selectedSourceFile();
cached
File getEncodedFile(string name) { result.getAbsolutePath().replaceAll(":", "_") = name }
from Top e, Top def, string kind
where def = definitionOf(e, kind) and e.getFile() = getEncodedFile(selectedSourceFile())
select e, def, kind

View File

@@ -11,9 +11,6 @@ import definitions
external string selectedSourceFile();
cached
File getEncodedFile(string name) { result.getAbsolutePath().replaceAll(":", "_") = name }
from Top e, Top def, string kind
where def = definitionOf(e, kind) and def.getFile() = getEncodedFile(selectedSourceFile())
select e, def, kind