mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
gh-98831: Modernize FORMAT_VALUE (#101628)
Generator update: support balanced parentheses and brackets in conditions and size expressions.
This commit is contained in:
parent
aacbdb0c65
commit
b2b85b5db9
5 changed files with 24 additions and 35 deletions
|
@ -333,7 +333,7 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
|
|||
case BUILD_SLICE:
|
||||
return ((oparg == 3) ? 1 : 0) + 2;
|
||||
case FORMAT_VALUE:
|
||||
return -1;
|
||||
return (((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0) + 1;
|
||||
case COPY:
|
||||
return (oparg-1) + 1;
|
||||
case BINARY_OP:
|
||||
|
@ -681,7 +681,7 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
|
|||
case BUILD_SLICE:
|
||||
return 1;
|
||||
case FORMAT_VALUE:
|
||||
return -1;
|
||||
return 1;
|
||||
case COPY:
|
||||
return (oparg-1) + 2;
|
||||
case BINARY_OP:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue