[pypy-svn] r15087 - in pypy/dist/pypy: interpreter lib lib/test2 module/marshal module/marshal/test tool translator

arigo at codespeak.net arigo at codespeak.net
Tue Jul 26 10:08:56 CEST 2005


Author: arigo
Date: Tue Jul 26 10:08:45 2005
New Revision: 15087

Added:
   pypy/dist/pypy/module/marshal/   (props changed)
   pypy/dist/pypy/module/marshal/__init__.py   (contents, props changed)
   pypy/dist/pypy/module/marshal/app_marshal.py
      - copied, changed from r15086, pypy/dist/pypy/lib/marshal.py
   pypy/dist/pypy/module/marshal/test/   (props changed)
   pypy/dist/pypy/module/marshal/test/autopath.py
      - copied unchanged from r15085, pypy/dist/pypy/module/sys/test/autopath.py
   pypy/dist/pypy/module/marshal/test/test_marshal_extra.py
      - copied, changed from r15085, pypy/dist/pypy/lib/test2/test_marshal_extra.py
Removed:
   pypy/dist/pypy/lib/marshal.py
   pypy/dist/pypy/lib/test2/test_marshal_extra.py
Modified:
   pypy/dist/pypy/interpreter/baseobjspace.py
   pypy/dist/pypy/interpreter/pycompiler.py
   pypy/dist/pypy/tool/option.py
   pypy/dist/pypy/translator/geninterplevel.py
Log:
- moved marshal to a mixed module.
- a few changes to geninterplevel to support it.
- an option --compile="pyparseapp" to call the stablecompiler
   pure Python package at app-level (to be done!).


Modified: pypy/dist/pypy/interpreter/baseobjspace.py
==============================================================================
--- pypy/dist/pypy/interpreter/baseobjspace.py	(original)
+++ pypy/dist/pypy/interpreter/baseobjspace.py	Tue Jul 26 10:08:45 2005
@@ -149,6 +149,7 @@
         # XXX we need to resolve unwrapping issues to 
         #     make this the default _sre module
         #self.setbuiltinmodule("_sre", "_sre_pypy")
+        self.setbuiltinmodule('marshal')
         if self.options.useparsermodule == "recparser":
              self.setbuiltinmodule('parser', 'recparser')
         elif self.options.useparsermodule == "parser":
@@ -196,6 +197,8 @@
             return PythonCompiler(self)
         elif self.options.compiler == 'cpython':
             return CPythonCompiler(self)
+        elif self.options.compiler == 'pyparseapp':
+            return PythonCompilerApp(self)
         else:
             raise ValueError('unknown --compiler option value: %r' % (
                 self.options.compiler,))

Modified: pypy/dist/pypy/interpreter/pycompiler.py
==============================================================================
--- pypy/dist/pypy/interpreter/pycompiler.py	(original)
+++ pypy/dist/pypy/interpreter/pycompiler.py	Tue Jul 26 10:08:45 2005
@@ -238,6 +238,39 @@
     compile_parse_result._annspecialcase_ = 'override:cpy_stablecompiler'
 
 
+##class PythonCompilerApp(PythonCompiler):
+##    """Temporary.  Calls the stablecompiler package at app-level."""
+
+##    def __init__(self, space):
+##        PythonCompiler.__init__(self, space)
+##        space.appexec(r'''():
+##            # NOT_RPYTHON
+##            from pypy.interpreter import stablecompiler
+##            from pypy.interpreter.stablecompiler.pycodegen import ModuleCodeGenerator
+##            from pypy.interpreter.stablecompiler.pycodegen import InteractiveCodeGenerator
+##            from pypy.interpreter.stablecompiler.pycodegen import ExpressionCodeGenerator
+##            from pypy.interpreter.stablecompiler.transformer import Transformer
+##            transformer = Transformer()
+##            tree = transformer.compile_node(tuples)
+##            stablecompiler.misc.set_filename(filename, tree)
+##            if mode == 'exec':
+##                codegenerator = ModuleCodeGenerator(tree)
+##            elif mode == 'single':
+##                codegenerator = InteractiveCodeGenerator(tree)
+##            else: # mode == 'eval':
+##                codegenerator = ExpressionCodeGenerator(tree)
+##            c = codegenerator.getCode()
+##        ''')
+
+##    def compile_parse_result(self, parse_result, filename, mode):
+
+
+
+
+        
+        
+
+
 class PyPyCompiler(CPythonCompiler):
     """Uses the PyPy implementation of Compiler
 

Deleted: /pypy/dist/pypy/lib/marshal.py
==============================================================================
--- /pypy/dist/pypy/lib/marshal.py	Tue Jul 26 10:08:45 2005
+++ (empty file)
@@ -1,432 +0,0 @@
-"""Marshal module written in Python.
-
-This doesn't marshal code objects, but supports everything else.
-Performance or careful error checking is not an issue.
-
-"""
-
-import StringIO
-import string
-from types import *
-try:
-    import new
-except ImportError:
-    new = None
-
-TYPE_NULL     = '0'
-TYPE_NONE     = 'N'
-TYPE_FALSE    = 'F'
-TYPE_TRUE     = 'T'
-TYPE_STOPITER = 'S'
-TYPE_ELLIPSIS = '.'
-TYPE_INT      = 'i'
-TYPE_INT64    = 'I'
-TYPE_FLOAT    = 'f'
-TYPE_COMPLEX  = 'x'
-TYPE_LONG     = 'l'
-TYPE_STRING   = 's'
-TYPE_INTERNED = 't'
-TYPE_STRINGREF= 'R'
-TYPE_TUPLE    = '('
-TYPE_LIST     = '['
-TYPE_DICT     = '{'
-TYPE_CODE     = 'c'
-TYPE_UNICODE  = 'u'
-TYPE_UNKNOWN  = '?'
-TYPE_SET      = '<'
-TYPE_FROZENSET= '>'
-
-class Marshaller:
-
-    dispatch = {}
-
-    def __init__(self, f):
-        self.f = f
-
-    def dump(self, x):
-        try:
-            self.dispatch[type(x)](self, x)
-        except KeyError:
-            for tp in type(x).mro():
-                func = self.dispatch.get(tp)
-                if func:
-                    break
-            else:
-                raise ValueError, "unmarshallable object"
-            func(self, x)
-
-    def w_long64(self, x):
-        self.w_long(x)
-        self.w_long(x>>32)
-
-    def w_long(self, x):
-        write = self.f.write
-        write(chr((x)     & 0xff))
-        write(chr((x>> 8) & 0xff))
-        write(chr((x>>16) & 0xff))
-        write(chr((x>>24) & 0xff))
-
-    def w_short(self, x):
-        write = self.f.write
-        write(chr((x)     & 0xff))
-        write(chr((x>> 8) & 0xff))
-
-    def dump_none(self, x):
-        self.f.write(TYPE_NONE)
-    dispatch[NoneType] = dump_none
-
-    def dump_bool(self, x):
-        if x:
-            self.f.write(TYPE_TRUE)
-        else:
-            self.f.write(TYPE_FALSE)
-    dispatch[bool] = dump_bool
-
-    def dump_stopiter(self, x):
-        if x is not StopIteration:
-            raise ValueError, "unmarshallable object"
-        self.f.write(TYPE_STOPITER)
-    dispatch[type(StopIteration)] = dump_stopiter
-
-    def dump_ellipsis(self, x):
-        self.f.write(TYPE_ELLIPSIS)
-    
-    try:
-        dispatch[EllipsisType] = dump_ellipsis
-    except NameError:
-        pass
-
-    def dump_int(self, x):
-        y = x>>31
-        if y and y != -1:
-            self.f.write(TYPE_INT64)
-            self.w_long64(x)
-        else:
-            self.f.write(TYPE_INT)
-            self.w_long(x)
-    dispatch[IntType] = dump_int
-
-    def dump_long(self, x):
-        self.f.write(TYPE_LONG)
-        sign = 1
-        if x < 0:
-            sign = -1
-            x = -x
-        digits = []
-        while x:
-            digits.append(x & 0x7FFF)
-            x = x>>15
-        self.w_long(len(digits) * sign)
-        for d in digits:
-            self.w_short(d)
-    dispatch[LongType] = dump_long
-
-    def dump_float(self, x):
-        write = self.f.write
-        write(TYPE_FLOAT)
-        s = `x`
-        write(chr(len(s)))
-        write(s)
-    dispatch[FloatType] = dump_float
-
-    def dump_complex(self, x):
-        write = self.f.write
-        write(TYPE_COMPLEX)
-        s = `x.real`
-        write(chr(len(s)))
-        write(s)
-        s = `x.imag`
-        write(chr(len(s)))
-        write(s)
-    try:
-        dispatch[ComplexType] = dump_complex
-    except NameError:
-        pass
-
-    def dump_string(self, x):
-        # XXX we can't check for interned strings, yet,
-        # so we (for now) never create TYPE_INTERNED or TYPE_STRINGREF
-        self.f.write(TYPE_STRING)
-        self.w_long(len(x))
-        self.f.write(x)
-    dispatch[StringType] = dump_string
-
-    def dump_unicode(self, x):
-        self.f.write(TYPE_UNICODE)
-        s = x.encode('utf8')
-        self.w_long(len(s))
-        self.f.write(s)
-    dispatch[UnicodeType] = dump_unicode
-
-    def dump_tuple(self, x):
-        self.f.write(TYPE_TUPLE)
-        self.w_long(len(x))
-        for item in x:
-            self.dump(item)
-    dispatch[TupleType] = dump_tuple
-
-    def dump_list(self, x):
-        self.f.write(TYPE_LIST)
-        self.w_long(len(x))
-        for item in x:
-            self.dump(item)
-    dispatch[ListType] = dump_list
-
-    def dump_dict(self, x):
-        self.f.write(TYPE_DICT)
-        for key, value in x.items():
-            self.dump(key)
-            self.dump(value)
-        self.f.write(TYPE_NULL)
-    dispatch[DictionaryType] = dump_dict
-
-    def dump_code(self, x):
-        self.f.write(TYPE_CODE)
-        self.w_long(x.co_argcount)
-        self.w_long(x.co_nlocals)
-        self.w_long(x.co_stacksize)
-        self.w_long(x.co_flags)
-        self.dump(x.co_code)
-        self.dump(x.co_consts)
-        self.dump(x.co_names)
-        self.dump(x.co_varnames)
-        self.dump(x.co_freevars)
-        self.dump(x.co_cellvars)
-        self.dump(x.co_filename)
-        self.dump(x.co_name)
-        self.w_long(x.co_firstlineno)
-        self.dump(x.co_lnotab)
-    try:
-        dispatch[CodeType] = dump_code
-    except NameError:
-        pass
-
-    def dump_set(self, x):
-        self.f.write(TYPE_SET)
-        self.w_long(len(x))
-        for each in x:
-            self.dump(each)
-    try:
-        dispatch[set] = dump_set
-    except NameError:
-        pass
-
-    def dump_frozenset(self, x):
-        self.f.write(TYPE_FROZENSET)
-        self.w_long(len(x))
-        for each in x:
-            self.dump(each)
-    try:
-        dispatch[frozenset] = dump_frozenset
-    except NameError:
-        pass
-
-class NULL:
-    pass
-
-class Unmarshaller:
-
-    dispatch = {}
-
-    def __init__(self, f):
-        self.f = f
-        self._stringtable = []
-
-    def load(self):
-        c = self.f.read(1)
-        if not c:
-            raise EOFError
-        return self.dispatch[c](self)
-
-    def r_short(self):
-        read = self.f.read
-        lo = ord(read(1))
-        hi = ord(read(1))
-        x = lo | (hi<<8)
-        if x & 0x8000:
-            x = x - 0x10000
-        return x
-
-    def r_long(self):
-        read = self.f.read
-        a = ord(read(1))
-        b = ord(read(1))
-        c = ord(read(1))
-        d = ord(read(1))
-        x = a | (b<<8) | (c<<16) | (d<<24)
-        if d & 0x80 and x > 0:
-            x = -((1L<<32) - x)
-        return x
-
-    def r_long64(self):
-        read = self.f.read
-        a = ord(read(1))
-        b = ord(read(1))
-        c = ord(read(1))
-        d = ord(read(1))
-        e = long(ord(read(1)))
-        f = long(ord(read(1)))
-        g = long(ord(read(1)))
-        h = long(ord(read(1)))
-        x = a | (b<<8) | (c<<16) | (d<<24)
-        x = x | (e<<32) | (f<<40) | (g<<48) | (h<<56)
-        if h & 0x80 and x > 0:
-            x = -((1L<<64) - x)
-        return x
-
-    def load_null(self):
-        return NULL
-    dispatch[TYPE_NULL] = load_null
-
-    def load_none(self):
-        return None
-    dispatch[TYPE_NONE] = load_none
-
-    def load_true(self):
-        return True
-    dispatch[TYPE_TRUE] = load_true
-
-    def load_false(self):
-        return False
-    dispatch[TYPE_FALSE] = load_false
-
-    def load_stopiter(self):
-        return StopIteration
-    dispatch[TYPE_STOPITER] = load_stopiter
-
-    def load_ellipsis(self):
-        return Ellipsis
-    dispatch[TYPE_ELLIPSIS] = load_ellipsis
-
-    def load_int(self):
-        return self.r_long()
-    dispatch[TYPE_INT] = load_int
-
-    def load_int64(self):
-        return self.r_long64()
-    dispatch[TYPE_INT64] = load_int64
-
-    def load_long(self):
-        size = self.r_long()
-        sign = 1
-        if size < 0:
-            sign = -1
-            size = -size
-        x = 0L
-        for i in range(size):
-            d = self.r_short()
-            x = x | (d<<(i*15L))
-        return x * sign
-    dispatch[TYPE_LONG] = load_long
-
-    def load_float(self):
-        n = ord(self.f.read(1))
-        s = self.f.read(n)
-        return string.atof(s)
-    dispatch[TYPE_FLOAT] = load_float
-
-    def load_complex(self):
-        n = ord(self.f.read(1))
-        s = self.f.read(n)
-        real = float(s)
-        n = ord(self.f.read(1))
-        s = self.f.read(n)
-        imag = float(s)
-        return complex(real, imag)
-    dispatch[TYPE_COMPLEX] = load_complex
-
-    def load_string(self):
-        n = self.r_long()
-        return self.f.read(n)
-    dispatch[TYPE_STRING] = load_string
-
-    def load_interned(self):
-        n = self.r_long()
-        ret = intern(self.f.read(n))
-        self._stringtable.append(ret)
-        return ret
-    dispatch[TYPE_INTERNED] = load_interned
-
-    def load_stringref(self):
-        n = self.r_long()
-        return self._stringtable[n]
-    dispatch[TYPE_STRINGREF] = load_stringref
-
-    def load_unicode(self):
-        n = self.r_long()
-        s = self.f.read(n)
-        ret = s.decode('utf8')
-        return ret
-    dispatch[TYPE_UNICODE] = load_unicode
-
-    def load_tuple(self):
-        return tuple(self.load_list())
-    dispatch[TYPE_TUPLE] = load_tuple
-
-    def load_list(self):
-        n = self.r_long()
-        list = []
-        for i in range(n):
-            list.append(self.load())
-        return list
-    dispatch[TYPE_LIST] = load_list
-
-    def load_dict(self):
-        d = {}
-        while 1:
-            key = self.load()
-            if key is NULL:
-                break
-            value = self.load()
-            d[key] = value
-        return d
-    dispatch[TYPE_DICT] = load_dict
-
-    def load_code(self):
-        argcount = self.r_long()
-        nlocals = self.r_long()
-        stacksize = self.r_long()
-        flags = self.r_long()
-        code = self.load()
-        consts = self.load()
-        names = self.load()
-        varnames = self.load()
-        freevars = self.load()
-        cellvars = self.load()
-        filename = self.load()
-        name = self.load()
-        firstlineno = self.r_long()
-        lnotab = self.load()
-        if not new:
-            raise RuntimeError, "can't unmarshal code objects; no 'new' module"
-        return new.code(argcount, nlocals, stacksize, flags, code, consts,
-                        names, varnames, filename, name, firstlineno, lnotab,
-                        freevars, cellvars)
-    dispatch[TYPE_CODE] = load_code
-
-    def load_set(self):
-        n = self.r_long()
-        args = [self.load() for i in range(n)]
-        return set(args)
-    dispatch[TYPE_SET] = load_set
-
-    def load_frozenset(self):
-        n = self.r_long()
-        args = [self.load() for i in range(n)]
-        return frozenset(args)
-    dispatch[TYPE_FROZENSET] = load_frozenset
-
-def dump(x, f):
-    Marshaller(f).dump(x)
-
-def load(f):
-    return Unmarshaller(f).load()
-
-def dumps(x):
-    f = StringIO.StringIO()
-    dump(x, f)
-    return f.getvalue()
-
-def loads(s):
-    f = StringIO.StringIO(s)
-    return load(f)

Deleted: /pypy/dist/pypy/lib/test2/test_marshal_extra.py
==============================================================================
--- /pypy/dist/pypy/lib/test2/test_marshal_extra.py	Tue Jul 26 10:08:45 2005
+++ (empty file)
@@ -1,89 +0,0 @@
-import sys
-import marshal as cpy_marshal
-from pypy.lib import marshal
-
-hello = "he"
-hello += "llo"
-def func(x):
-    return lambda y: x+y
-scopefunc = func(42)
-
-TESTCASES = [
-    None,
-    False,
-    True,
-    StopIteration,
-    Ellipsis,
-    42,
-    sys.maxint,
-    -1.25,
-    2+5j,
-    42L,
-    -1234567890123456789012345678901234567890L,
-    hello,   # not interned
-    "hello",
-    (),
-    (1, 2),
-    [],
-    [3, 4],
-    {},
-    {5: 6, 7: 8},
-    func.func_code,
-    scopefunc.func_code,
-    u'hello',
-    ]
-
-try:
-    TESTCASES += [
-        set(),
-        set([1, 2]),
-        frozenset(),
-        frozenset([3, 4]),
-        ]
-except NameError:
-    pass    # Python < 2.4
-
-
-def test_cases():
-    for case in TESTCASES:
-        yield dump_and_reload, case
-        yield load_from_cpython, case
-        yield dump_to_cpython, case
-        yield dump_subclass, case
-
-def dump_and_reload(case):
-    print 'dump_and_reload', `case`
-    s = marshal.dumps(case)
-    obj = marshal.loads(s)
-    assert obj == case
-
-def load_from_cpython(case):
-    print 'load_from_cpython', `case`
-    try:
-        s = cpy_marshal.dumps(case)
-    except ValueError:
-        return   # this version of CPython doesn't support this object
-    obj = marshal.loads(s)
-    assert obj == case
-
-def dump_to_cpython(case):
-    print 'dump_to_cpython', `case`
-    try:
-        cpy_marshal.dumps(case)
-    except ValueError:
-        return   # this version of CPython doesn't support this object
-    s = marshal.dumps(case)
-    obj = cpy_marshal.loads(s)
-    assert obj == case
-
-def dump_subclass(case):
-    try:
-        class Subclass(type(case)):
-            pass
-        case = Subclass(case)
-    except TypeError:
-        return
-    print 'dump_subclass', `case`
-    s = marshal.dumps(case)
-    obj = marshal.loads(s)
-    assert obj == case

Added: pypy/dist/pypy/module/marshal/__init__.py
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/module/marshal/__init__.py	Tue Jul 26 10:08:45 2005
@@ -0,0 +1,16 @@
+from pypy.interpreter.mixedmodule import MixedModule 
+
+class Module(MixedModule):
+    """Internal Python object serialization
+
+This module contains functions that can read and write Python values in a binary format. The format is specific to Python, but independent of machine architecture issues (e.g., you can write a Python value to a file on a PC, transport the file to a Sun, and read it back there). Details of the format may change between Python versions."""
+
+    appleveldefs = {
+        'dump'          : 'app_marshal.dump',
+        'dumps'         : 'app_marshal.dumps',
+        'load'          : 'app_marshal.load',
+        'loads'         : 'app_marshal.loads',
+    }
+
+    interpleveldefs = {
+    }

Copied: pypy/dist/pypy/module/marshal/app_marshal.py (from r15086, pypy/dist/pypy/lib/marshal.py)
==============================================================================
--- pypy/dist/pypy/lib/marshal.py	(original)
+++ pypy/dist/pypy/module/marshal/app_marshal.py	Tue Jul 26 10:08:45 2005
@@ -1,13 +1,9 @@
 """Marshal module written in Python.
-
-This doesn't marshal code objects, but supports everything else.
-Performance or careful error checking is not an issue.
-
 """
 
 import StringIO
 import string
-from types import *
+import types
 try:
     import new
 except ImportError:
@@ -73,7 +69,7 @@
 
     def dump_none(self, x):
         self.f.write(TYPE_NONE)
-    dispatch[NoneType] = dump_none
+    dispatch[types.NoneType] = dump_none
 
     def dump_bool(self, x):
         if x:
@@ -92,7 +88,7 @@
         self.f.write(TYPE_ELLIPSIS)
     
     try:
-        dispatch[EllipsisType] = dump_ellipsis
+        dispatch[types.EllipsisType] = dump_ellipsis
     except NameError:
         pass
 
@@ -104,7 +100,7 @@
         else:
             self.f.write(TYPE_INT)
             self.w_long(x)
-    dispatch[IntType] = dump_int
+    dispatch[types.IntType] = dump_int
 
     def dump_long(self, x):
         self.f.write(TYPE_LONG)
@@ -119,7 +115,7 @@
         self.w_long(len(digits) * sign)
         for d in digits:
             self.w_short(d)
-    dispatch[LongType] = dump_long
+    dispatch[types.LongType] = dump_long
 
     def dump_float(self, x):
         write = self.f.write
@@ -127,7 +123,7 @@
         s = `x`
         write(chr(len(s)))
         write(s)
-    dispatch[FloatType] = dump_float
+    dispatch[types.FloatType] = dump_float
 
     def dump_complex(self, x):
         write = self.f.write
@@ -139,7 +135,7 @@
         write(chr(len(s)))
         write(s)
     try:
-        dispatch[ComplexType] = dump_complex
+        dispatch[types.ComplexType] = dump_complex
     except NameError:
         pass
 
@@ -149,28 +145,28 @@
         self.f.write(TYPE_STRING)
         self.w_long(len(x))
         self.f.write(x)
-    dispatch[StringType] = dump_string
+    dispatch[types.StringType] = dump_string
 
     def dump_unicode(self, x):
         self.f.write(TYPE_UNICODE)
         s = x.encode('utf8')
         self.w_long(len(s))
         self.f.write(s)
-    dispatch[UnicodeType] = dump_unicode
+    dispatch[types.UnicodeType] = dump_unicode
 
     def dump_tuple(self, x):
         self.f.write(TYPE_TUPLE)
         self.w_long(len(x))
         for item in x:
             self.dump(item)
-    dispatch[TupleType] = dump_tuple
+    dispatch[types.TupleType] = dump_tuple
 
     def dump_list(self, x):
         self.f.write(TYPE_LIST)
         self.w_long(len(x))
         for item in x:
             self.dump(item)
-    dispatch[ListType] = dump_list
+    dispatch[types.ListType] = dump_list
 
     def dump_dict(self, x):
         self.f.write(TYPE_DICT)
@@ -178,7 +174,7 @@
             self.dump(key)
             self.dump(value)
         self.f.write(TYPE_NULL)
-    dispatch[DictionaryType] = dump_dict
+    dispatch[types.DictionaryType] = dump_dict
 
     def dump_code(self, x):
         self.f.write(TYPE_CODE)
@@ -197,7 +193,7 @@
         self.w_long(x.co_firstlineno)
         self.dump(x.co_lnotab)
     try:
-        dispatch[CodeType] = dump_code
+        dispatch[types.CodeType] = dump_code
     except NameError:
         pass
 
@@ -416,6 +412,13 @@
         return frozenset(args)
     dispatch[TYPE_FROZENSET] = load_frozenset
 
+try:
+    set
+except NameError:
+    def set(x):
+        raise ValueError("cannot unmarshal set objects on Python < 2.4")
+    frozenset = set
+
 def dump(x, f):
     Marshaller(f).dump(x)
 

Copied: pypy/dist/pypy/module/marshal/test/test_marshal_extra.py (from r15085, pypy/dist/pypy/lib/test2/test_marshal_extra.py)
==============================================================================
--- pypy/dist/pypy/lib/test2/test_marshal_extra.py	(original)
+++ pypy/dist/pypy/module/marshal/test/test_marshal_extra.py	Tue Jul 26 10:08:45 2005
@@ -1,6 +1,7 @@
+import autopath
 import sys
 import marshal as cpy_marshal
-from pypy.lib import marshal
+from pypy.module.marshal import app_marshal as marshal
 
 hello = "he"
 hello += "llo"

Modified: pypy/dist/pypy/tool/option.py
==============================================================================
--- pypy/dist/pypy/tool/option.py	(original)
+++ pypy/dist/pypy/tool/option.py	Tue Jul 26 10:08:45 2005
@@ -12,7 +12,8 @@
     uselibfile = 0
     useparsermodule = "recparser" # "cpython" / "recparser" / "parser"
     compiler = "pyparse" # "cpython"
-                         # "pyparse" pypy parser, cpython compiler
+                         # "pyparse" pypy parser, cpython's compiler package
+                         # "pyparseapp" same, running the compiler at app-level
                          # "pycomp" pypy parser and compiler (TBD)
     version = "2.4" # "native" / "2.3" / "2.4"
 
@@ -47,7 +48,7 @@
     options.append(make_option(
         '--compiler', action="store", type="string", dest="compiler",
         help="select the parser/compiler to use internally",
-        metavar="[cpython|pyparse]"))
+        metavar="[cpython|pyparse|pyparseapp]"))
     options.append(make_option(
         '--parsermodule', action="store",type="string", dest="useparsermodule",
         help="select the parser module to use",

Modified: pypy/dist/pypy/translator/geninterplevel.py
==============================================================================
--- pypy/dist/pypy/translator/geninterplevel.py	(original)
+++ pypy/dist/pypy/translator/geninterplevel.py	Tue Jul 26 10:08:45 2005
@@ -77,7 +77,7 @@
 import pypy # __path__
 import py.path
 
-GI_VERSION = '1.1.3'  # bump this for substantial changes
+GI_VERSION = '1.1.4'  # bump this for substantial changes
 # ____________________________________________________________
 
 def eval_helper(self, typename, expr):
@@ -747,9 +747,9 @@
         str:    'space.w_str',
         float:  'space.w_float',
         slice:  'space.w_slice',
-        type(Exception()): 'space.wrap(types.InstanceType)',
+        type(Exception()): (eval_helper, 'InstanceType', 'types.InstanceType'),
         type:   'space.w_type',
-        complex:'space.wrap(types.ComplexType)',
+        complex: (eval_helper, 'complex', 'types.ComplexType'),
         unicode:'space.w_unicode',
         basestring: (eval_helper, 'basestring', 'basestring'),
         file:   (eval_helper, 'file', 'file'),
@@ -785,6 +785,7 @@
         types.MethodType: (eval_helper, "instancemethod",
             "type((lambda:42).__get__(42))"),
         property: (eval_helper, "property", 'property'),
+        type(Ellipsis): (eval_helper, 'EllipsisType', 'types.EllipsisType'),
     }
 
     def nameof_type(self, cls):



More information about the Pypy-commit mailing list