Exemple #1
0
    def setup_constants(self):
        dct = OrderedDict()
        for modulename, lst in get_constants_by_module(self):
            for k, w_obj in lst:
                dct[k] = w_obj
        dct['PHP_INT_MAX'] = self.wrap(sys.maxint)
        dct['PHP_INT_SIZE'] = self.wrap(4 if sys.maxint < 2**32 else 8)

        self._setup_constant_any_case('true', self.w_True, dct)
        self._setup_constant_any_case('false', self.w_False, dct)
        self._setup_constant_any_case('null', self.w_Null, dct)

        self.prebuilt_constants = dct.keys()
        self.global_constant_cache = GlobalImmutCache(self,
                                                      dct,
                                                      force_lowcase=False)
Exemple #2
0
 def setup_classes(self):
     self.prebuilt_classes = all_builtin_classes.keys()
     self.global_class_cache = GlobalImmutCache(self, all_builtin_classes)
Exemple #3
0
 def setup_functions(self):
     self.global_function_cache = GlobalImmutCache(self, BUILTIN_FUNCTIONS)