Commit 3ed85507 authored by Stefan Behnel's avatar Stefan Behnel

support non-trivial switch() values in SwitchStatNode

parent ac32ea7a
...@@ -4105,6 +4105,7 @@ class SwitchStatNode(StatNode): ...@@ -4105,6 +4105,7 @@ class SwitchStatNode(StatNode):
child_attrs = ['test', 'cases', 'else_clause'] child_attrs = ['test', 'cases', 'else_clause']
def generate_execution_code(self, code): def generate_execution_code(self, code):
self.test.generate_evaluation_code(code)
code.putln("switch (%s) {" % self.test.result()) code.putln("switch (%s) {" % self.test.result())
for case in self.cases: for case in self.cases:
case.generate_execution_code(code) case.generate_execution_code(code)
......
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