Commit 882d16d1 authored by HoytKoepke's avatar HoytKoepke

Annotation fix when no else clause.

parent 7c0ea3b0
...@@ -3041,7 +3041,7 @@ class SwitchCaseNode(StatNode): ...@@ -3041,7 +3041,7 @@ class SwitchCaseNode(StatNode):
def annotate(self, code): def annotate(self, code):
for cond in self.conditions: for cond in self.conditions:
cond.annotate(code) cond.annotate(code)
body.annotate(code) self.body.annotate(code)
class SwitchStatNode(StatNode): class SwitchStatNode(StatNode):
# Generated in the optimization of an if-elif-else node # Generated in the optimization of an if-elif-else node
...@@ -3065,6 +3065,7 @@ class SwitchStatNode(StatNode): ...@@ -3065,6 +3065,7 @@ class SwitchStatNode(StatNode):
self.test.annotate(code) self.test.annotate(code)
for case in self.cases: for case in self.cases:
case.annotate(code) case.annotate(code)
if self.else_clause is not None:
self.else_clause.annotate(code) self.else_clause.annotate(code)
class LoopNode: class LoopNode:
......
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