mirror of
https://github.com/python/cpython.git
synced 2025-08-27 04:05:34 +00:00
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).
This commit is contained in:
parent
5fec904f84
commit
c2e20744b2
23 changed files with 1853 additions and 816 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue