Commit 8cd527b4 authored by Stefan Behnel's avatar Stefan Behnel

remove dead code

parent df904591
...@@ -5528,13 +5528,11 @@ class ContinueStatNode(StatNode): ...@@ -5528,13 +5528,11 @@ class ContinueStatNode(StatNode):
return self return self
def generate_execution_code(self, code): def generate_execution_code(self, code):
code.mark_pos(self.pos) if not code.continue_label:
if code.funcstate.in_try_finally:
error(self.pos, "continue statement inside try of try...finally")
elif not code.continue_label:
error(self.pos, "continue statement not inside loop") error(self.pos, "continue statement not inside loop")
else: return
code.put_goto(code.continue_label) code.mark_pos(self.pos)
code.put_goto(code.continue_label)
class ReturnStatNode(StatNode): class ReturnStatNode(StatNode):
...@@ -6970,11 +6968,6 @@ class TryFinallyStatNode(StatNode): ...@@ -6970,11 +6968,6 @@ class TryFinallyStatNode(StatNode):
func_return_type = None func_return_type = None
finally_except_clause = None finally_except_clause = None
disallow_continue_in_try_finally = 0
# There doesn't seem to be any point in disallowing
# continue in the try block, since we have no problem
# handling it.
is_try_finally_in_nogil = False is_try_finally_in_nogil = False
@staticmethod @staticmethod
...@@ -7010,16 +7003,12 @@ class TryFinallyStatNode(StatNode): ...@@ -7010,16 +7003,12 @@ class TryFinallyStatNode(StatNode):
catch_label = code.new_label() catch_label = code.new_label()
code.putln("/*try:*/ {") code.putln("/*try:*/ {")
was_in_try_finally = code.funcstate.in_try_finally
if self.disallow_continue_in_try_finally: code.funcstate.in_try_finally = 1
was_in_try_finally = code.funcstate.in_try_finally
code.funcstate.in_try_finally = 1
self.body.generate_execution_code(code) self.body.generate_execution_code(code)
if self.disallow_continue_in_try_finally: code.funcstate.in_try_finally = was_in_try_finally
code.funcstate.in_try_finally = was_in_try_finally
code.putln("}") code.putln("}")
code.set_all_labels(old_labels) code.set_all_labels(old_labels)
......
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