示例#1
0
 def call(self, frame, anchor, args, kwargs):
   if kwargs:
     frame.raise_expt(ErrorConfig.NoKeywordArgs())
     return UndefinedTypeNode.get_object()
   if len(args) < self.minargs:
     frame.raise_expt(ErrorConfig.InvalidNumOfArgs(self.minargs, len(args)))
     return UndefinedTypeNode.get_object()
   return self.MapCaller(frame, anchor, args[0], args[1:])
示例#2
0
 def call(self, frame, anchor, args, kwargs):
     if kwargs:
         frame.raise_expt(ErrorConfig.NoKeywordArgs())
         return UndefinedTypeNode.get_object()
     if len(args) < self.minargs:
         frame.raise_expt(
             ErrorConfig.InvalidNumOfArgs(self.minargs, len(args)))
         return UndefinedTypeNode.get_object()
     return self.MapCaller(frame, anchor, args[0], args[1:])
示例#3
0
 def process_args(self, frame, anchor, args, kwargs):
   if kwargs:
     frame.raise_expt(ErrorConfig.NoKeywordArgs())
     return UndefinedTypeNode.get_object()
   if args:
     return self.create_sequence(frame, anchor, args[0])
   return self.create_null(frame, anchor)
 def process_args(self, frame, anchor, args, kwargs):
     if kwargs:
         frame.raise_expt(ErrorConfig.NoKeywordArgs())
         return UndefinedTypeNode.get_object()
     if args:
         return self.create_sequence(frame, anchor, args[0])
     return self.create_null(frame, anchor)
 def process_args(self, frame, anchor, args, kwargs):
     if kwargs:
         frame.raise_expt(ErrorConfig.NoKeywordArgs())
         return UndefinedTypeNode.get_object()
     elemall = TupleType.create_tuple(
         [IntType.get_object(),
          IterElement(frame, anchor, args[0])])
     return IterObject(self.get_typeobj(), elemall=elemall)
示例#6
0
 def call(self, frame, anchor, args, kwargs):
   from pyntch.config import ErrorConfig
   if len(args) == 0:
     frame.raise_expt(ErrorConfig.InvalidNumOfArgs(1, len(args)))
     return UndefinedTypeNode.get_object()
   arg0checker = TypeChecker(frame, [self.klass], 'arg0')
   args[0].connect(arg0checker.recv)
   return self.func.call(frame, anchor, args, kwargs)
示例#7
0
 def call(self, frame, anchor, args, kwargs):
   if kwargs:
     frame.raise_expt(ErrorConfig.NoKeywordArgs())
     return UndefinedTypeNode.get_object()
   elems = [ CompoundTypeNode() for arg1 in args ]
   zipelem = TupleType.create_tuple(elements=elems)
   seq = ListType.create_list(elemall=zipelem)
   for (i,arg1) in enumerate(args):
     IterElement(frame, anchor, arg1).connect(elems[i].recv)
   return seq
示例#8
0
 def call(self, frame, anchor, args, kwargs):
     if kwargs:
         frame.raise_expt(ErrorConfig.NoKeywordArgs())
         return UndefinedTypeNode.get_object()
     elems = [CompoundTypeNode() for arg1 in args]
     zipelem = TupleType.create_tuple(elements=elems)
     seq = ListType.create_list(elemall=zipelem)
     for (i, arg1) in enumerate(args):
         IterElement(frame, anchor, arg1).connect(elems[i].recv)
     return seq
示例#9
0
 def call(self, frame, anchor, args, kwargs):
   if kwargs:
     frame.raise_expt(ErrorConfig.NoKeywordArgs())
     return UndefinedTypeNode.get_object()
   retobj = CompoundTypeNode()
   if len(args) == 1:
     IterElement(frame, anchor, args[0]).connect(retobj.recv)
   else:
     for arg1 in args:
       arg1.connect(retobj.recv)
   if 'key' in kwargs:
     IterFuncChecker(frame, anchor, retobj, kwargs['key'])
   return retobj
示例#10
0
 def call(self, frame, anchor, args, kwargs):
     if kwargs:
         frame.raise_expt(ErrorConfig.NoKeywordArgs())
         return UndefinedTypeNode.get_object()
     retobj = CompoundTypeNode()
     if len(args) == 1:
         IterElement(frame, anchor, args[0]).connect(retobj.recv)
     else:
         for arg1 in args:
             arg1.connect(retobj.recv)
     if 'key' in kwargs:
         IterFuncChecker(frame, anchor, retobj, kwargs['key'])
     return retobj
示例#11
0
 def call(self, frame, anchor, args, kwargs):
     if self.TYPE_NAME == 'basestring':
         frame.raise_expt(ErrorConfig.NotInstantiatable('basestring'))
         return UndefinedTypeNode.get_object()
     return BuiltinConstCallable.call(self, frame, anchor, args, kwargs)
示例#12
0
 def process_args(self, frame, anchor, args, kwargs):
   if kwargs:
     frame.raise_expt(ErrorConfig.NoKeywordArgs())
     return UndefinedTypeNode.get_object()
   return self.process_args_nokwd(frame, anchor, args)
示例#13
0
 def call(self, frame, anchor, args, kwargs):
   if self.TYPE_NAME == 'basestring':
     frame.raise_expt(ErrorConfig.NotInstantiatable('basestring'))
     return UndefinedTypeNode.get_object()
   return BuiltinConstCallable.call(self, frame, anchor, args, kwargs)
示例#14
0
 def process_args(self, frame, anchor, args, kwargs):
     if kwargs:
         frame.raise_expt(ErrorConfig.NoKeywordArgs())
         return UndefinedTypeNode.get_object()
     return self.process_args_nokwd(frame, anchor, args)
示例#15
0
 def process_args(self, frame, anchor, args, kwargs):
   if kwargs:
     frame.raise_expt(ErrorConfig.NoKeywordArgs())
     return UndefinedTypeNode.get_object()
   return self.MethodConverter(self.get_typeobj(), self.wrapper, args[0])
示例#16
0
 def process_args(self, frame, anchor, args, kwargs):
     if kwargs:
         frame.raise_expt(ErrorConfig.NoKeywordArgs())
         return UndefinedTypeNode.get_object()
     return self.ReversedIterConverter(frame, anchor, args[0])
示例#17
0
 def process_args(self, frame, anchor, args, kwargs):
     if kwargs:
         frame.raise_expt(ErrorConfig.NoKeywordArgs())
         return UndefinedTypeNode.get_object()
     return self.MethodConverter(self.get_typeobj(), self.wrapper, args[0])
示例#18
0
 def process_args(self, frame, anchor, args, kwargs):
   if kwargs:
     frame.raise_expt(ErrorConfig.NoKeywordArgs())
     return UndefinedTypeNode.get_object()
   elemall = TupleType.create_tuple([IntType.get_object(), IterElement(frame, anchor, args[0])])
   return IterObject(self.get_typeobj(), elemall=elemall)
示例#19
0
 def process_args(self, frame, anchor, args, kwargs):
   if kwargs:
     frame.raise_expt(ErrorConfig.NoKeywordArgs())
     return UndefinedTypeNode.get_object()
   return self.ReversedIterConverter(frame, anchor, args[0])