diff options
Diffstat (limited to 'pp2cc.py')
-rwxr-xr-x | pp2cc.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -378,7 +378,9 @@ class LinkedNode(object): return self.parent.getContinueNode() return None def setLabel(self, label_name): - """Sets the label for this node""" + """Sets the label for this node and return the label name as it appears + in assembly + """ if self.parent: function = self.parent.getFunctionNode() if not self.parent or not function: @@ -393,6 +395,7 @@ class LinkedNode(object): i += 1 function.goto_labels[label_name] = label_asm + return label_asm def lookupLabel(self, label_name): """Returns the label name as it appears in assembly for label_name""" # get the nearest function for this node @@ -1334,8 +1337,7 @@ class Parse(object): return lines def parseLabel(self, linked_node): lines = [] - label_name = linked_node.node.name - linked_node.setLabel(label_name) + label_name = linked_node.setLabel(linked_node.node.name) lines.append(self.asm.noop(label_name)) lines += self.parseStatement(linked_node.node.stmt, linked_node) return lines |