Commit 2e5c9135 authored by Amaury Forgeot d'Arc's avatar Amaury Forgeot d'Arc

Some missing _fields

parent 88b57b0e
......@@ -3134,7 +3134,7 @@ class comprehension(AST):
_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 @@ class arguments(AST):
_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 @@ class keyword(AST):
_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 @@ class alias(AST):
_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):
......
......@@ -42,6 +42,10 @@ class TestAstToObject:
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,
......
......@@ -118,7 +118,8 @@ class ASTNodeVisitor(ASDLVisitor):
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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment