def call(methodname, receiver, arguments, builtins): method = primitives[methodname] args = [] args.append(receiver.getvalue('').intvalue()) for a in arguments: if a: args.append(a.intvalue()) else: args.append(0) my_int = W_Integer(method(args)) my_int.builtins = builtins return my_int
def op_int_literal(self, arg): i = W_Integer(arg) i.builtins = self.interpreter.builtins self.stack.append(i)
def test_integer(): w1 = W_Integer(5) assert w1.value == 5 # W_Integer objects cannot have custom attributes, # so getvalue() returns None. assert w1.getvalue('abc') is None
def eval_IntLiteral(self, ast, context): int = W_Integer(ast.value) int.builtins = self.builtins return int