Kaydet (Commit) 0d5faf3a authored tarafından Whyz Geek's avatar Whyz Geek Kaydeden (comit) Berker Peksag

added missing arguments vistor from Armin's original repo

üst 23c3432b
......@@ -8,3 +8,4 @@ And with some modifications based on Armin's code:
* Patrick Maupin <pmaupin@gmail.com>
* Abhishek L <abhishek.lekshmanan@gmail.com>
* Bob Tolbert <bob@eyesopen.com>
* Whyzgeek <whyzgeek@gmail.com>
......@@ -8,3 +8,4 @@
information.
0.4 -- Added a visitor for NameConstant.
Added initial test suite and documentation.
0.4.1 -- Added missing SourceGenerator.visit_arguments()
......@@ -9,7 +9,7 @@ Copyright 2013 (c) Berker Peksag
"""
__version__ = '0.4'
__version__ = '0.4.1'
from .codegen import to_source # NOQA
from .misc import iter_node, dump, all_symbols, get_anyop # NOQA
......
......@@ -507,3 +507,6 @@ class SourceGenerator(ExplicitNodeVisitor):
if node.ifs:
for if_ in node.ifs:
self.write(' if ', if_)
def visit_arguments(self, node):
self.signature(node)
......@@ -47,6 +47,13 @@ class CodegenTestCase(unittest.TestCase):
source = "del obj.x"
self.assertAstSourceEqual(source)
def test_arguments(self):
source = textwrap.dedent("""\
j = [1, 2, 3]
def test(a1, a2, b1=j, b2='123', b3={}, b4=[]):
pass""")
self.assertAstSourceEqual(source)
if __name__ == '__main__':
unittest.main()
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