Commit 9b8e292e authored by Shane Hathaway's avatar Shane Hathaway

Corrected the handling of POP_TOP in redirected print statements with

multiple clauses.
parent 2c1c0ed2
...@@ -806,10 +806,10 @@ class CodeGenerator: ...@@ -806,10 +806,10 @@ class CodeGenerator:
if node.dest: if node.dest:
self.emit('ROT_TWO') self.emit('ROT_TWO')
self.emit('PRINT_ITEM_TO') self.emit('PRINT_ITEM_TO')
if not newline:
self.emit('POP_TOP')
else: else:
self.emit('PRINT_ITEM') self.emit('PRINT_ITEM')
if node.dest and not newline:
self.emit('POP_TOP')
def visitPrintnl(self, node): def visitPrintnl(self, node):
self.visitPrint(node, 1) self.visitPrint(node, 1)
......
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