示例#1
0
    def visit_Call(self, node):
        func_type = node.func.type

        if self.query(node, "is_math") and node.type.is_numeric:
            assert node.func.type.is_known_value
            name = get_funcname(node.func.type.value)
            result = math_call(self.env, name, node.args, node.type)

        elif func_type.is_builtin:
            result = self.builtin_resolver.resolve_builtin_call_or_object(
                node, func_type.func)

        else:
            result = nodes.call_obj(node)

        return self.visit(result)
示例#2
0
    def visit_Call(self, node):
        func_type = node.func.type

        if self.query(node, "is_math") and node.type.is_numeric:
            assert node.func.type.is_known_value
            name = get_funcname(node.func.type.value)
            result = math_call(name, node.args, node.type)

        elif func_type.is_builtin:
            result = self.builtin_resolver.resolve_builtin_call_or_object(
                node, func_type.func)

        else:
            result = nodes.call_obj(node)

        return self.visit(result)
示例#3
0
def resolve_call_or_none(context, call_node, func_type):
    if (func_type.is_known_value and is_registered(func_type.value)):
        # Try the module type inferers
        new_node = nodes.call_obj(call_node, None)
        return resolve_call(context, call_node, new_node, func_type)
示例#4
0
def resolve_call_or_none(context, call_node, func_type):
    if (func_type.is_known_value and
            is_registered(func_type.value)):
        # Try the module type inferers
        new_node = nodes.call_obj(call_node, None)
        return resolve_call(context, call_node, new_node, func_type)