def recursiverule(e): newe = rule(e) writer.write_if_enabled(newe, str(rule)) LOG.debug("apply rule %s\n" + colored(" -", "red") + " %s" + "\n" + colored(" +", "green") + " %s", rule, e, newe) newe.apply(recursiverule) return newe
def recursiverule(e): newe = rule(e) writer.write_if_enabled(newe, str(rule)) # log the optimizer step if str(e) == str(newe): LOG.debug("apply rule %s (no effect)\n" + " %s \n", rule, e) else: LOG.debug("apply rule %s\n" + colored(" -", "red") + " %s" + "\n" + colored(" +", "green") + " %s", rule, e, newe) newe.apply(recursiverule) return newe
def recursiverule(e): newe = rule(e) writer.write_if_enabled(newe, str(rule)) if newe.stop_recursion: return newe # log the optimizer step if str(e) == str(newe): LOG.debug("apply rule %s (no effect)\n" + " %s \n", rule, e) else: LOG.debug( "apply rule %s\n" + colored(" -", "red") + " %s" + "\n" + colored(" +", "green") + " %s", rule, e, newe) newe.apply(recursiverule) return newe