[pypy-commit] pypy py3.5-async: Implement handle_async_stmt, Parameter bugfix

raffael_t pypy.commits at gmail.com
Tue Jul 5 11:57:30 EDT 2016


Author: Raffael Tfirst <raffael.tfirst at gmail.com>
Branch: py3.5-async
Changeset: r85565:aedfbe75e2b9
Date: 2016-07-05 16:54 +0200
http://bitbucket.org/pypy/pypy/changeset/aedfbe75e2b9/

Log:	Implement handle_async_stmt, Parameter bugfix

diff --git a/pypy/interpreter/astcompiler/astbuilder.py b/pypy/interpreter/astcompiler/astbuilder.py
--- a/pypy/interpreter/astcompiler/astbuilder.py
+++ b/pypy/interpreter/astcompiler/astbuilder.py
@@ -494,10 +494,21 @@
                                    funcdef_node.get_lineno(), funcdef_node.get_column())
 
     def handle_async_funcdef(self, node, decorators=None):
-        return handle_funcdef_impl(node.get_child(1), decorators, 1)
+        return handle_funcdef_impl(node.get_child(1), 1, decorators)
     
     def handle_funcdef(self, node, decorators=None):
-        return handle_funcdef_impl(node, decorators, 0)
+        return handle_funcdef_impl(node, 0, decorators)
+    
+    def handle_async_stmt(self, node):
+        ch = node.get_child(1)
+        if ch.type == syms.funcdef:
+            return handle_funcdef_impl(ch, 1)
+        elif ch.type == syms.with_stmt:
+            return handle_with_stmt(ch, 1)
+        elif ch.type == syms.for_stmt:
+            return handle_for_stmt(ch, 1)
+        else:
+            raise AssertionError("invalid async statement")
 
     def handle_decorated(self, decorated_node):
         decorators = self.handle_decorators(decorated_node.get_child(0))


More information about the pypy-commit mailing list