Commit bd12d52a authored by Dylan Trotter's avatar Dylan Trotter

Replace return with continue so that except handlers get executed.

parent d8cb4982
...@@ -225,10 +225,10 @@ class StatementVisitor(ast.NodeVisitor): ...@@ -225,10 +225,10 @@ class StatementVisitor(ast.NodeVisitor):
tmpl = textwrap.dedent("""\ tmpl = textwrap.dedent("""\
}).Eval(πF, πF.Globals(), nil, nil) }).Eval(πF, πF.Globals(), nil, nil)
if πE != nil { if πE != nil {
\treturn nil, πE \tcontinue
} }
if $meta, πE = $cls.GetItem(πF, $metaclass_str.ToObject()); πE != nil { if $meta, πE = $cls.GetItem(πF, $metaclass_str.ToObject()); πE != nil {
\treturn nil, πE \tcontinue
} }
if $meta == nil { if $meta == nil {
\t$meta = πg.TypeType.ToObject() \t$meta = πg.TypeType.ToObject()
...@@ -342,7 +342,7 @@ class StatementVisitor(ast.NodeVisitor): ...@@ -342,7 +342,7 @@ class StatementVisitor(ast.NodeVisitor):
with self.block.alloc_temp('bool') as is_true: with self.block.alloc_temp('bool') as is_true:
self.writer.write_tmpl(textwrap.dedent("""\ self.writer.write_tmpl(textwrap.dedent("""\
if $is_true, πE = πg.IsTrue(πF, $cond); πE != nil { if $is_true, πE = πg.IsTrue(πF, $cond); πE != nil {
\treturn nil, πE \tcontinue
} }
if $is_true { if $is_true {
\tgoto Label$label \tgoto Label$label
......
Markdown is supported
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