looks like everything is working except for try/except (pystone

compiles correctly)
This commit is contained in:
Jeremy Hylton 2000-02-14 21:33:10 +00:00
parent 17988d2a17
commit 126960b744
2 changed files with 28 additions and 12 deletions

View File

@ -153,11 +153,6 @@ class CodeGenerator:
"""TODO
EmptyNode
Exec
Invert
LeftShift
Power
RightShift
Sliceobj
Tryexcept
Tryfinally
@ -276,6 +271,8 @@ class CodeGenerator:
self.emit('SET_LINENO', node.lineno)
self.emit('IMPORT_NAME', node.modname)
for name in node.names:
if name == '*':
self.namespace = 0
self.emit('IMPORT_FROM', name)
self.emit('POP_TOP')
@ -524,7 +521,6 @@ class CodeGenerator:
return 1
def visitAssign(self, node):
print "ASSIGN", node.expr
self.emit('SET_LINENO', node.lineno)
self.visit(node.expr)
dups = len(node.nodes) - 1
@ -583,6 +579,18 @@ class CodeGenerator:
def visitMod(self, node):
return self.binaryOp(node, 'BINARY_MODULO')
def visitPower(self, node):
return self.binaryOp(node, 'BINARY_POWER')
def visitLeftShift(self, node):
return self.binaryOp(node, 'BINARY_LSHIFT')
def visitRightShift(self, node):
return self.binaryOp(node, 'BINARY_RSHIFT')
def visitInvert(self, node):
return self.unaryOp(node, 'UNARY_INVERT')
def visitUnarySub(self, node):
return self.unaryOp(node, 'UNARY_NEGATIVE')

View File

@ -153,11 +153,6 @@ class CodeGenerator:
"""TODO
EmptyNode
Exec
Invert
LeftShift
Power
RightShift
Sliceobj
Tryexcept
Tryfinally
@ -276,6 +271,8 @@ class CodeGenerator:
self.emit('SET_LINENO', node.lineno)
self.emit('IMPORT_NAME', node.modname)
for name in node.names:
if name == '*':
self.namespace = 0
self.emit('IMPORT_FROM', name)
self.emit('POP_TOP')
@ -524,7 +521,6 @@ class CodeGenerator:
return 1
def visitAssign(self, node):
print "ASSIGN", node.expr
self.emit('SET_LINENO', node.lineno)
self.visit(node.expr)
dups = len(node.nodes) - 1
@ -583,6 +579,18 @@ class CodeGenerator:
def visitMod(self, node):
return self.binaryOp(node, 'BINARY_MODULO')
def visitPower(self, node):
return self.binaryOp(node, 'BINARY_POWER')
def visitLeftShift(self, node):
return self.binaryOp(node, 'BINARY_LSHIFT')
def visitRightShift(self, node):
return self.binaryOp(node, 'BINARY_RSHIFT')
def visitInvert(self, node):
return self.unaryOp(node, 'UNARY_INVERT')
def visitUnarySub(self, node):
return self.unaryOp(node, 'UNARY_NEGATIVE')