Skip to content
Snippets Groups Projects
Commit bdc1e12d authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Add Stringifier.map_if().

parent c3bc6237
No related branches found
No related tags found
No related merge requests found
......@@ -195,6 +195,12 @@ class StringifyMapper(pymbolic.mapper.RecursiveMapper):
return self.format("%s(%s)",
type_name, self.rec(expr.child, PREC_NONE))
def map_if(self, expr, enclosing_prec):
return "If(%s, %s, %s)" % (
self.rec(expr.condition, PREC_NONE),
self.rec(expr.then, PREC_NONE),
self.rec(expr.else_, PREC_NONE))
def map_if_positive(self, expr, enclosing_prec):
return "If(%s > 0, %s, %s)" % (
self.rec(expr.criterion, PREC_NONE),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment