tests: fix instruction "return" in Perl/Guile/PHP output

This commit is contained in:
Sébastien Helleu 2017-10-10 19:42:35 +02:00
parent ee6f28ef18
commit 358297ba8f

View File

@ -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('$', '\\$'))