mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +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())
|
result = node.getMember(token.getAnArgument())
|
||||||
or
|
or
|
||||||
token.getName() = "Instance" and
|
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
|
or
|
||||||
token.getName() = "Awaited" and
|
token.getName() = "Awaited" and
|
||||||
result = node.getAwaited()
|
result = node.getAwaited()
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ isSource
|
|||||||
| test.py:39:11:39:20 | ControlFlowNode for Await | test-source |
|
| test.py:39:11:39:20 | ControlFlowNode for Await | test-source |
|
||||||
| test.py:41:8:41:27 | ControlFlowNode for Attribute() | 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:46:7:46:16 | ControlFlowNode for SubClass() | test-source |
|
||||||
|
| test.py:51:8:51:18 | ControlFlowNode for Sub2Class() | test-source |
|
||||||
syntaxErrors
|
syntaxErrors
|
||||||
| Member[foo |
|
| Member[foo |
|
||||||
| Member[foo] .Member[bar] |
|
| Member[foo] .Member[bar] |
|
||||||
|
|||||||
@@ -43,4 +43,9 @@ inst = CommonTokens.Class()
|
|||||||
class SubClass (CommonTokens.Super):
|
class SubClass (CommonTokens.Super):
|
||||||
pass
|
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: Uniform tokens for fields
|
||||||
// TODO: Non-positional arguments (including Named parameters)
|
// TODO: Non-positional arguments (including Named parameters)
|
||||||
// TODO: Any argument
|
// TODO: Any argument
|
||||||
|
|||||||
Reference in New Issue
Block a user