[pypy-commit] pypy py3.3: Don't parse version from Python.asdl anymore.

amauryfa noreply at buildbot.pypy.org
Mon Apr 21 18:36:32 CEST 2014


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3.3
Changeset: r70818:19c656d8c9ca
Date: 2014-04-21 16:08 +0200
http://bitbucket.org/pypy/pypy/changeset/19c656d8c9ca/

Log:	Don't parse version from Python.asdl anymore.

diff --git a/pypy/interpreter/astcompiler/tools/asdl.py b/pypy/interpreter/astcompiler/tools/asdl.py
--- a/pypy/interpreter/astcompiler/tools/asdl.py
+++ b/pypy/interpreter/astcompiler/tools/asdl.py
@@ -108,26 +108,19 @@
     def error(self, tok):
         raise ASDLSyntaxError(tok.lineno, tok)
 
-    def p_module_0(self, (module, name, version, _0, _1)):
-        " module ::= Id Id version { } "
+    def p_module_0(self, (module, name, _0, _1)):
+        " module ::= Id Id { } "
         if module.value != "module":
             raise ASDLSyntaxError(module.lineno,
                                   msg="expected 'module', found %s" % module)
-        return Module(name, None, version)
+        return Module(name, None)
 
-    def p_module(self, (module, name, version, _0, definitions, _1)):
-        " module ::= Id Id version { definitions } "
+    def p_module(self, (module, name, _0, definitions, _1)):
+        " module ::= Id Id { definitions } "
         if module.value != "module":
             raise ASDLSyntaxError(module.lineno,
                                   msg="expected 'module', found %s" % module)
-        return Module(name, definitions, version)
-
-    def p_version(self, (version, V)):
-        "version ::= Id String"
-        if version.value != "version":
-            raise ASDLSyntaxError(version.lineno,
-                                msg="expected 'version', found %" % version)
-        return V
+        return Module(name, definitions)
 
     def p_definition_0(self, (definition,)):
         " definitions ::= definition "
@@ -228,10 +221,9 @@
     pass # a marker class
 
 class Module(AST):
-    def __init__(self, name, dfns, version):
+    def __init__(self, name, dfns):
         self.name = name
         self.dfns = dfns
-        self.version = version
         self.types = {} # maps type name to value (from dfns)
         for type in dfns:
             self.types[type.name.value] = type.value


More information about the pypy-commit mailing list