Beispiel #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:])
Beispiel #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:])
Beispiel #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)
Beispiel #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)
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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])
 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])
Beispiel #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])
Beispiel #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)
Beispiel #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])