Author: Amaury Forgeot d'Arc <[email protected]>
Branch: split-ast-classes
Changeset: r65031:2b627c6e72e0
Date: 2013-06-27 01:01 +0200
http://bitbucket.org/pypy/pypy/changeset/2b627c6e72e0/

Log:    Some missing _fields

diff --git a/pypy/interpreter/astcompiler/ast.py 
b/pypy/interpreter/astcompiler/ast.py
--- a/pypy/interpreter/astcompiler/ast.py
+++ b/pypy/interpreter/astcompiler/ast.py
@@ -3134,7 +3134,7 @@
         _ifs = [expr.from_object(space, w_item) for w_item in ifs_w]
         return comprehension(_target, _iter, _ifs)
 
-State.ast_type('comprehension', 'AST', None)
+State.ast_type('comprehension', 'AST', ['target', 'iter', 'ifs'])
 
 class excepthandler(AST):
 
@@ -3260,7 +3260,7 @@
         _defaults = [expr.from_object(space, w_item) for w_item in defaults_w]
         return arguments(_args, _vararg, _kwarg, _defaults)
 
-State.ast_type('arguments', 'AST', None)
+State.ast_type('arguments', 'AST', ['args', 'vararg', 'kwarg', 'defaults'])
 
 class keyword(AST):
 
@@ -3291,7 +3291,7 @@
         _value = expr.from_object(space, w_value)
         return keyword(_arg, _value)
 
-State.ast_type('keyword', 'AST', None)
+State.ast_type('keyword', 'AST', ['arg', 'value'])
 
 class alias(AST):
 
@@ -3321,7 +3321,7 @@
         _asname = space.str_or_None_w(w_asname)
         return alias(_name, _asname)
 
-State.ast_type('alias', 'AST', None)
+State.ast_type('alias', 'AST', ['name', 'asname'])
 
 class ASTVisitor(object):
 
diff --git a/pypy/interpreter/astcompiler/test/test_ast.py 
b/pypy/interpreter/astcompiler/test/test_ast.py
--- a/pypy/interpreter/astcompiler/test/test_ast.py
+++ b/pypy/interpreter/astcompiler/test/test_ast.py
@@ -42,6 +42,10 @@
                                  space.wrap("_fields"))
         assert space.eq_w(w_fields, space.wrap(
             ('name', 'args', 'body', 'decorator_list')))
+        w_fields = space.getattr(ast.get(space).w_arguments,
+                                 space.wrap("_fields"))
+        assert space.eq_w(w_fields, space.wrap(
+            ('args', 'vararg', 'kwarg', 'defaults')))
         
     def test_attributes(self, space):
         w_attrs = space.getattr(ast.get(space).w_FunctionDef,
diff --git a/pypy/interpreter/astcompiler/tools/asdl_py.py 
b/pypy/interpreter/astcompiler/tools/asdl_py.py
--- a/pypy/interpreter/astcompiler/tools/asdl_py.py
+++ b/pypy/interpreter/astcompiler/tools/asdl_py.py
@@ -118,7 +118,8 @@
         self.emit("visitor.visit_%s(self)" % (name,), 2)
         self.emit("")
         self.make_converters(product.fields, name)
-        self.emit("State.ast_type('%r', 'AST', None)" % (name,))
+        self.emit("State.ast_type('%r', 'AST', %s)" %
+                  (name, [repr(f.name) for f in product.fields]))
         self.emit("")
 
     def get_value_converter(self, field, value):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to