Python: Add some more utility predicates and classes to the new 'Value' API.

This commit is contained in:
Mark Shannon
2019-08-02 10:00:16 +01:00
parent 5496fa41c8
commit 63f24dfe18
4 changed files with 76 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
| file://:0:0:0:0 | Builtin-function exit | exit |
| file://:0:0:0:0 | Builtin-function len | len |
| file://:0:0:0:0 | builtin method append | list.append |
| test.py:8:1:8:10 | Function foo | foo |
| test.py:13:5:13:19 | Function C.meth | C.meth |

View File

@@ -0,0 +1,16 @@
import python
from FunctionValue v, string name
where name = v.getQualifiedName() and
(
v = Value::named("len")
or
v instanceof PythonFunctionValue
or
v = Value::named("sys.exit")
or
v = Value::named("list").(ClassValue).lookup("append")
)
select v, name

View File

@@ -4,3 +4,11 @@ u"c"
b"d"
1000
1004
def foo():
pass
class C(object):
def meth(self):
pass