Skip to content
Snippets Groups Projects
Commit fa4f153e authored by Jan Hönig's avatar Jan Hönig
Browse files

Reintroducting changes.

parent cb42f2c0
Branches
Tags
1 merge request!292Rebase of pystencils Type System
......@@ -377,8 +377,6 @@ class Block(Node):
return tmp
def replace(self, child, replacements):
if self._nodes.count(child) != 1:
print('here')
assert self._nodes.count(child) == 1
idx = self._nodes.index(child)
del self._nodes[idx]
......
......@@ -773,7 +773,7 @@ def simplify_conditionals(node: ast.Node, loop_counter_simplification: bool = Fa
"""
for conditional in node.atoms(ast.Conditional):
# TODO simplify conditional before the type system! Casts make it very hard here
# conditional.condition_expr = sp.simplify(conditional.condition_expr)
conditional.condition_expr = sp.simplify(conditional.condition_expr)
if conditional.condition_expr == sp.true:
conditional.parent.replace(conditional, [conditional.true_block])
elif conditional.condition_expr == sp.false:
......
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