diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2000-02-14 21:33:10 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2000-02-14 21:33:10 (GMT) |
commit | 126960b7443905cccc54a9aa5ca8e1205762a0e7 (patch) | |
tree | 53aca4e157fab629275b740286b2c96baa5f5f47 /Lib | |
parent | 17988d2a175dbf9acade5588a36913c96b591a17 (diff) | |
download | cpython-126960b7443905cccc54a9aa5ca8e1205762a0e7.zip cpython-126960b7443905cccc54a9aa5ca8e1205762a0e7.tar.gz cpython-126960b7443905cccc54a9aa5ca8e1205762a0e7.tar.bz2 |
looks like everything is working except for try/except (pystone
compiles correctly)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/compiler/pycodegen.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Lib/compiler/pycodegen.py b/Lib/compiler/pycodegen.py index ac93348..1c80499 100644 --- a/Lib/compiler/pycodegen.py +++ b/Lib/compiler/pycodegen.py @@ -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') |