add support for the any argument tokens

This commit is contained in:
Erik Krogh Kristensen
2022-05-02 12:58:15 +02:00
parent 413d182bcf
commit b1fa7f86a8
4 changed files with 22 additions and 1 deletions

View File

@@ -72,6 +72,12 @@ API::Node getExtraSuccessorFromNode(API::Node node, AccessPathToken token) {
exists(string name | token.getAnArgument() = name + ":" |
result = node.getKeywordParameter(name)
)
or
token.getAnArgument() = "any" and
result = [node.getParameter(_), node.getKeywordParameter(_)]
or
token.getAnArgument() = "any-named" and
result = node.getKeywordParameter(_)
)
// Some features don't have MaD tokens yet, they would need to be added to API-graphs first.
// - decorators ("DecoratedClass", "DecoratedMember", "DecoratedParameter")
@@ -182,7 +188,7 @@ predicate isExtraValidTokenArgumentInIdentifyingAccessPath(string name, string a
or
name = ["Argument", "Parameter"] and
(
argument = "self"
argument = ["self", "any", "any-named"]
or
argument.regexpMatch("\\w+:") // keyword argument
)