Exemple #1
0
 def __init__(self, frame, anchor, spec):
     self.checker = TypeChecker(frame, [TypeType.get_typeobj()], 'typespec')
     self.tuplechecker = SequenceTypeChecker(frame, anchor,
                                             [TypeType.get_typeobj()],
                                             'typespec')
     CompoundTypeNode.__init__(self)
     spec.connect(self.recv)
     return
Exemple #2
0
 def check_type(self):
   from pyntch.config import ErrorConfig
   from pyntch.basic_types import TypeType
   if self.validtypes == self.ANY: return
   for obj in self.received:
     for typeobj in self.validtypes:
       if typeobj.is_type(TypeType.get_typeobj()) and obj.is_type(typeobj):
         self.update_type(obj)
         break
     else:
       s = '|'.join( typeobj.typename() for typeobj in self.validtypes
                     if typeobj.is_type(TypeType.get_typeobj()) )
       self.parent_frame.raise_expt(ErrorConfig.TypeCheckerError(self.blame, obj, s))
   return
Exemple #3
0
 def __init__(self, frame, anchor, spec):
   self.checker = TypeChecker(frame, [TypeType.get_typeobj()], 'typespec')
   self.tuplechecker = SequenceTypeChecker(frame, anchor, [TypeType.get_typeobj()], 'typespec')
   CompoundTypeNode.__init__(self)
   spec.connect(self.recv)
   return
Exemple #4
0
 def is_type(klass, *typeobjs):
   from pyntch.basic_types import TypeType
   return TypeType.get_typeobj() in typeobjs
Exemple #5
0
 def get_type(klass):
   from pyntch.basic_types import TypeType
   return TypeType.get_typeobj()