def ternary(self, node):
self[node].clear()
+ test = self.ccall(name="oppc_bool", node=node, code=[
+ self[node.test],
+ ])
self[node].emit(stmt="(")
with self[node]:
- for (level, stmt) in self[node.test]:
+ for (level, stmt) in self[test]:
self[node].emit(stmt=stmt, level=level)
self[node].emit(stmt="?")
for (level, stmt) in self[node.body]:
@pc_util.Hook(pc_ast.IfExpr)
def IfExpr(self, node):
yield node
+ test = self.ccall(name="oppc_bool", node=node, code=[
+ self[node.test],
+ ])
self[node].emit(stmt="if (")
with self[node]:
- for (level, stmt) in self[node.test]:
+ for (level, stmt) in self[test]:
self[node].emit(stmt=stmt, level=level)
self[node].emit(stmt=") {")
for (level, stmt) in self[node.body]: