Skip to content
Snippets Groups Projects
Commit f5db4b53 authored by Martin Bauer's avatar Martin Bauer
Browse files

Merge branch 'Conditional.__repr__' into 'master'

Print actual block contents in Conditional.{__repr__,__str__}

See merge request !131
parents b0aae533 f4008b32
No related branches found
No related tags found
1 merge request!131Print actual block contents in Conditional.{__repr__,__str__}
Pipeline #21122 passed with warnings
...@@ -110,10 +110,17 @@ class Conditional(Node): ...@@ -110,10 +110,17 @@ class Conditional(Node):
return result return result
def __str__(self): def __str__(self):
return 'if:({!s}) '.format(self.condition_expr) return self.__repr__()
def __repr__(self): def __repr__(self):
return 'if:({!r}) '.format(self.condition_expr) repr = 'if:({!r}) '.format(self.condition_expr)
if self.true_block:
repr += '\n\t{}) '.format(self.true_block)
if self.false_block:
repr = 'else: '.format(self.false_block)
repr += '\n\t{} '.format(self.false_block)
return repr
def replace_by_true_block(self): def replace_by_true_block(self):
"""Replaces the conditional by its True block""" """Replaces the conditional by its True block"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment