summaryrefslogtreecommitdiff
path: root/tests/scripts/python/unparse.py
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-10-10 19:42:35 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-10-10 19:42:35 +0200
commit358297ba8f5329b0311729959ad15b1747c19a81 (patch)
treea9f22ebe54304de1bf23325d3b697c8fc0a5428e /tests/scripts/python/unparse.py
parentee6f28ef18f24d5a1927d9a0b4c27c0678b7d2f5 (diff)
downloadweechat-358297ba8f5329b0311729959ad15b1747c19a81.zip
tests: fix instruction "return" in Perl/Guile/PHP output
Diffstat (limited to 'tests/scripts/python/unparse.py')
-rwxr-xr-xtests/scripts/python/unparse.py17
1 files changed, 17 insertions, 0 deletions
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('$', '\\$'))