Commit 3c918b7f authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

Rename TempsBlockNode.get_ref_node -> new_ref_node

parent a67aaf75
...@@ -439,20 +439,20 @@ class WithTransform(CythonTransform): ...@@ -439,20 +439,20 @@ class WithTransform(CythonTransform):
u'EXPR' : node.manager, u'EXPR' : node.manager,
u'BODY' : node.body, u'BODY' : node.body,
u'TARGET' : node.target, u'TARGET' : node.target,
u'EXCINFO' : excinfo_tempblock.get_ref_node(0, node.pos) u'EXCINFO' : excinfo_tempblock.new_ref_node(0, node.pos)
}, pos=node.pos) }, pos=node.pos)
# Set except excinfo target to EXCINFO # Set except excinfo target to EXCINFO
result.body.stats[4].body.stats[0].except_clauses[0].excinfo_target = ( result.body.stats[4].body.stats[0].except_clauses[0].excinfo_target = (
excinfo_tempblock.get_ref_node(0, node.pos)) excinfo_tempblock.new_ref_node(0, node.pos))
else: else:
result = self.template_without_target.substitute({ result = self.template_without_target.substitute({
u'EXPR' : node.manager, u'EXPR' : node.manager,
u'BODY' : node.body, u'BODY' : node.body,
u'EXCINFO' : excinfo_tempblock.get_ref_node(0, node.pos) u'EXCINFO' : excinfo_tempblock.new_ref_node(0, node.pos)
}, pos=node.pos) }, pos=node.pos)
# Set except excinfo target to EXCINFO # Set except excinfo target to EXCINFO
result.body.stats[4].body.stats[0].except_clauses[0].excinfo_target = ( result.body.stats[4].body.stats[0].except_clauses[0].excinfo_target = (
excinfo_tempblock.get_ref_node(0, node.pos)) excinfo_tempblock.new_ref_node(0, node.pos))
excinfo_tempblock.body = result excinfo_tempblock.body = result
return excinfo_tempblock return excinfo_tempblock
......
...@@ -158,7 +158,7 @@ class TemplateTransform(VisitorTransform): ...@@ -158,7 +158,7 @@ class TemplateTransform(VisitorTransform):
return self.try_substitution(node, node.name) return self.try_substitution(node, node.name)
else: else:
# Replace name with temporary # Replace name with temporary
return self.tempblock.get_ref_node(tmpidx, self.get_pos(node)) return self.tempblock.new_ref_node(tmpidx, self.get_pos(node))
def visit_ExprStatNode(self, node): def visit_ExprStatNode(self, node):
# If an expression-as-statement consists of only a replaceable # If an expression-as-statement consists of only a replaceable
......
...@@ -58,7 +58,7 @@ class TempsBlockNode(Node): ...@@ -58,7 +58,7 @@ class TempsBlockNode(Node):
self.handles = [TempHandle(t) for t in types] self.handles = [TempHandle(t) for t in types]
Node.__init__(self, pos, body=body) Node.__init__(self, pos, body=body)
def get_ref_node(self, index, pos): def new_ref_node(self, index, pos):
handle = self.handles[index] handle = self.handles[index]
return TempRefNode(pos, handle=handle, type=handle.type) return TempRefNode(pos, handle=handle, type=handle.type)
......
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