582 print >>self.output, " try {" |
582 print >>self.output, " try {" |
583 for stmt in node.body.nodes: |
583 for stmt in node.body.nodes: |
584 self._stmt(stmt, current_klass) |
584 self._stmt(stmt, current_klass) |
585 print >> self.output, " } catch(%s) {" % errName |
585 print >> self.output, " } catch(%s) {" % errName |
586 if expr: |
586 if expr: |
587 l = [] |
587 k = [] |
588 if isinstance(expr, ast.Tuple): |
588 if isinstance(expr, ast.Tuple): |
589 for x in expr.nodes: |
589 for x in expr.nodes: |
590 l.append("(%(err)s.__name__ == %(expr)s.__name__)" % dict (err=errName, expr=self.expr(x, current_klass))) |
590 k.append("(%(err)s.__name__ == %(expr)s.__name__)" % dict (err=errName, expr=self.expr(x, current_klass))) |
591 else: |
591 else: |
592 l = [" (%(err)s.__name__ == %(expr)s.__name__) " % dict (err=errName, expr=self.expr(expr, current_klass))] |
592 k = [" (%(err)s.__name__ == %(expr)s.__name__) " % dict (err=errName, expr=self.expr(expr, current_klass))] |
593 print >> self.output, " if(%s) {" % '||\n\t\t'.join(l) |
593 print >> self.output, " if(%s) {" % '||\n\t\t'.join(k) |
594 for stmt in node.handlers[0][2]: |
594 for stmt in node.handlers[0][2]: |
595 self._stmt(stmt, current_klass) |
595 self._stmt(stmt, current_klass) |
596 if expr: |
596 if expr: |
597 #print >> self.output, "} else { throw(%s); } " % errName |
597 #print >> self.output, "} else { throw(%s); } " % errName |
598 print >> self.output, "}" |
598 print >> self.output, "}" |