Add extra module path for xmlpath package

This commit is contained in:
Owen Mansel-Chan
2021-02-22 15:07:56 +00:00
parent 2bcf73c9fb
commit 083512acef

View File

@@ -102,12 +102,12 @@ module XPath {
private class GoXmlpathXmlpathXPathExpressionString extends Range {
GoXmlpathXmlpathXPathExpressionString() {
exists(Function f, string name | name.matches("Compile%") |
f.hasQualifiedName(package("github.com/go-xmlpath/xmlpath", ""), name) and
f.hasQualifiedName(XmlPath::packagePath(), name) and
this = f.getACall().getArgument(0)
)
or
exists(Function f, string name | name.matches("MustCompile%") |
f.hasQualifiedName(package("github.com/go-xmlpath/xmlpath", ""), name) and
f.hasQualifiedName(XmlPath::packagePath(), name) and
this = f.getACall().getArgument(0)
)
}
@@ -164,3 +164,11 @@ module XPath {
}
}
}
module XmlPath {
/** Gets the package name `github.com/go-xmlpath/xmlpath` or `gopkg.in/xmlpath`. */
bindingset[result]
string packagePath() {
result = package(["github.com/go-xmlpath/xmlpath", "gopkg.in/xmlpath"], "")
}
}