예제 #1
0
 def op_primitive_method_call(self, arg):
     primitive = primitives.primitives_by_name[arg]
     arity = primitives.all_primitives_arg_count[arg]
     arguments = []
     for i in xrange(arity):
         arguments.append(self.stack.pop())
     receiver = self.stack.pop()
     res = primitives.call(primitive, receiver, arguments, self.interpreter.builtins)
     self.stack.append(res)
예제 #2
0
파일: interpreter.py 프로젝트: stepahn/slf
 def eval_PrimitiveMethodCall(self, ast, context):
     receiver = self.eval(ast.receiver, context)
     arguments = map(lambda a: self.eval(a, context), ast.arguments)
     return primitives.call(ast.methodname, receiver, arguments, self.builtins)