diff options
author | Guido van Rossum <guido@python.org> | 2006-02-27 22:32:47 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2006-02-27 22:32:47 (GMT) |
commit | c2e20744b2b7811632030470971c31630f0975e2 (patch) | |
tree | e97b1c1471fd00e4e5648ed317274c1d9005d2ca /Lib/opcode.py | |
parent | 5fec904f84a40005f824abe295525a1710056be0 (diff) | |
download | cpython-c2e20744b2b7811632030470971c31630f0975e2.zip cpython-c2e20744b2b7811632030470971c31630f0975e2.tar.gz cpython-c2e20744b2b7811632030470971c31630f0975e2.tar.bz2 |
PEP 343 -- the with-statement.
This was started by Mike Bland and completed by Guido
(with help from Neal).
This still needs a __future__ statement added;
Thomas is working on Michael's patch for that aspect.
There's a small amount of code cleanup and refactoring
in ast.c, compile.c and ceval.c (I fixed the lltrace
behavior when EXT_POP is used -- however I had to make
lltrace a static global).
Diffstat (limited to 'Lib/opcode.py')
-rw-r--r-- | Lib/opcode.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Lib/opcode.py b/Lib/opcode.py index 9517c43..095ca42 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -41,6 +41,7 @@ def jabs_op(name, op): hasjabs.append(op) # Instruction opcodes for compiled code +# Blank lines correspond to available opcodes def_op('STOP_CODE', 0) def_op('POP_TOP', 1) @@ -59,7 +60,6 @@ def_op('UNARY_INVERT', 15) def_op('LIST_APPEND', 18) def_op('BINARY_POWER', 19) - def_op('BINARY_MULTIPLY', 20) def_op('BINARY_DIVIDE', 21) def_op('BINARY_MODULO', 22) @@ -70,7 +70,6 @@ def_op('BINARY_FLOOR_DIVIDE', 26) def_op('BINARY_TRUE_DIVIDE', 27) def_op('INPLACE_FLOOR_DIVIDE', 28) def_op('INPLACE_TRUE_DIVIDE', 29) - def_op('SLICE+0', 30) def_op('SLICE+1', 31) def_op('SLICE+2', 32) @@ -93,7 +92,6 @@ def_op('INPLACE_DIVIDE', 58) def_op('INPLACE_MODULO', 59) def_op('STORE_SUBSCR', 60) def_op('DELETE_SUBSCR', 61) - def_op('BINARY_LSHIFT', 62) def_op('BINARY_RSHIFT', 63) def_op('BINARY_AND', 64) @@ -113,13 +111,12 @@ def_op('INPLACE_AND', 77) def_op('INPLACE_XOR', 78) def_op('INPLACE_OR', 79) def_op('BREAK_LOOP', 80) - +def_op('WITH_CLEANUP', 81) def_op('LOAD_LOCALS', 82) def_op('RETURN_VALUE', 83) def_op('IMPORT_STAR', 84) def_op('EXEC_STMT', 85) def_op('YIELD_VALUE', 86) - def_op('POP_BLOCK', 87) def_op('END_FINALLY', 88) def_op('BUILD_CLASS', 89) @@ -171,7 +168,6 @@ def_op('RAISE_VARARGS', 130) # Number of raise arguments (1, 2, or 3) def_op('CALL_FUNCTION', 131) # #args + (#kwargs << 8) def_op('MAKE_FUNCTION', 132) # Number of args with default values def_op('BUILD_SLICE', 133) # Number of items - def_op('MAKE_CLOSURE', 134) def_op('LOAD_CLOSURE', 135) hasfree.append(135) @@ -183,7 +179,6 @@ hasfree.append(137) def_op('CALL_FUNCTION_VAR', 140) # #args + (#kwargs << 8) def_op('CALL_FUNCTION_KW', 141) # #args + (#kwargs << 8) def_op('CALL_FUNCTION_VAR_KW', 142) # #args + (#kwargs << 8) - def_op('EXTENDED_ARG', 143) EXTENDED_ARG = 143 |