From 358297ba8f5329b0311729959ad15b1747c19a81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 10 Oct 2017 19:42:35 +0200 Subject: [PATCH] tests: fix instruction "return" in Perl/Guile/PHP output --- tests/scripts/python/unparse.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/scripts/python/unparse.py b/tests/scripts/python/unparse.py index 9f235a5d7..303a69cc5 100755 --- a/tests/scripts/python/unparse.py +++ b/tests/scripts/python/unparse.py @@ -456,6 +456,12 @@ class UnparsePerl(UnparsePython): """Add an AST Pass in output.""" pass + def _ast_return(self, node): + """Add an AST Return in output.""" + self.fill('return') + if node.value: + self.add(' ', node.value, ';') + def _ast_str(self, node): """Add an AST Str in output.""" self.add('"%s"' % node.s.replace('$', '\\$')) @@ -954,6 +960,11 @@ class UnparseGuile(UnparsePython): """Add an AST Pass in output.""" pass + def _ast_return(self, node): + """Add an AST Return in output.""" + if node.value: + self.add(self.fill, node.value) + def _ast_str(self, node): """Add an AST Str in output.""" self.add('"%s"' % node.s) @@ -1149,6 +1160,12 @@ class UnparsePhp(UnparsePython): """Add an AST Pass in output.""" pass + def _ast_return(self, node): + """Add an AST Return in output.""" + self.fill('return') + if node.value: + self.add(' ', node.value, ';') + def _ast_str(self, node): """Add an AST Str in output.""" self.add('"%s"' % node.s.replace('$', '\\$'))