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
Branches
Tags
1 merge request!131Print actual block contents in Conditional.{__repr__,__str__}
Pipeline #21122 passed with warnings with stages
in 2 minutes and 56 seconds
......@@ -110,10 +110,17 @@ class Conditional(Node):
return result
def __str__(self):
return 'if:({!s}) '.format(self.condition_expr)
return self.__repr__()
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):
"""Replaces the conditional by its True block"""
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment