Commit 35a90d1c authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

DictNode, newtemps and so on

parent cfcf8605
...@@ -3424,7 +3424,7 @@ class SetNode(NewTempExprNode): ...@@ -3424,7 +3424,7 @@ class SetNode(NewTempExprNode):
arg.free_temps(code) arg.free_temps(code)
class DictNode(ExprNode): class DictNode(NewTempExprNode):
# Dictionary constructor. # Dictionary constructor.
# #
# key_value_pairs [DictItemNode] # key_value_pairs [DictItemNode]
...@@ -3492,19 +3492,11 @@ class DictNode(ExprNode): ...@@ -3492,19 +3492,11 @@ class DictNode(ExprNode):
gil_message = "Constructing Python dict" gil_message = "Constructing Python dict"
def allocate_temps(self, env, result = None):
# Custom method used here because key-value
# pairs are evaluated and used one at a time.
self.allocate_temp(env, result)
for item in self.key_value_pairs:
item.key.allocate_temps(env)
item.value.allocate_temps(env)
item.key.release_temp(env)
item.value.release_temp(env)
def generate_evaluation_code(self, code): def generate_evaluation_code(self, code):
# Custom method used here because key-value # Custom method used here because key-value
# pairs are evaluated and used one at a time. # pairs are evaluated and used one at a time.
code.mark_pos(self.pos)
self.allocate_temp_result(code)
if self.type.is_pyobject: if self.type.is_pyobject:
self.release_errors() self.release_errors()
code.putln( code.putln(
......
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