mirror of
https://github.com/github/codeql.git
synced 2025-12-21 11:16:30 +01:00
have the Instance token be an alias for Subclass.ReturnValue
This commit is contained in:
@@ -53,7 +53,7 @@ API::Node getExtraSuccessorFromNode(API::Node node, AccessPathToken token) {
|
||||
result = node.getMember(token.getAnArgument())
|
||||
or
|
||||
token.getName() = "Instance" and
|
||||
result = node.getReturn() // commonly used Token. In Python `Instance` is just an alias for `ReturnValue`
|
||||
result = node.getASubclass*().getReturn() // In Python `Instance` is just an alias for `Subclass.ReturnValue`
|
||||
or
|
||||
token.getName() = "Awaited" and
|
||||
result = node.getAwaited()
|
||||
|
||||
@@ -41,6 +41,7 @@ isSource
|
||||
| test.py:39:11:39:20 | ControlFlowNode for Await | test-source |
|
||||
| test.py:41:8:41:27 | ControlFlowNode for Attribute() | test-source |
|
||||
| test.py:46:7:46:16 | ControlFlowNode for SubClass() | test-source |
|
||||
| test.py:51:8:51:18 | ControlFlowNode for Sub2Class() | test-source |
|
||||
syntaxErrors
|
||||
| Member[foo |
|
||||
| Member[foo] .Member[bar] |
|
||||
|
||||
@@ -43,4 +43,9 @@ inst = CommonTokens.Class()
|
||||
class SubClass (CommonTokens.Super):
|
||||
pass
|
||||
|
||||
sub = SubClass()
|
||||
sub = SubClass()
|
||||
|
||||
class Sub2Class (CommonTokens.Class):
|
||||
pass
|
||||
|
||||
sub2 = Sub2Class()
|
||||
@@ -53,8 +53,6 @@ class Sinks extends ModelInput::SinkModelCsv {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Commonly used tokens
|
||||
// TODO: Should `instance()` be shorthand for `subClass*().getReturn()`?
|
||||
// TODO: Uniform tokens for fields
|
||||
// TODO: Non-positional arguments (including Named parameters)
|
||||
// TODO: Any argument
|
||||
|
||||
Reference in New Issue
Block a user