comprehension in lambda for 3.0 & 3.1

This commit is contained in:
rocky 2023-08-12 07:12:10 -04:00
parent 9a14d2dea8
commit b3ddf95d7a
3 changed files with 16 additions and 2 deletions

Binary file not shown.

View File

@ -81,9 +81,17 @@ class Python3Parser(PythonParser):
set_comp_func ::= BUILD_SET_0 LOAD_ARG FOR_ITER store comp_iter
JUMP_BACK RETURN_VALUE RETURN_LAST
set_comp_func ::= BUILD_SET_0 LOAD_ARG FOR_ITER store comp_iter
JUMP_BACK RETURN_VALUE_LAMBDA LAMBDA_MARKER
set_comp_func ::= BUILD_SET_0 LOAD_FAST FOR_ITER store comp_iter
JUMP_BACK RETURN_VALUE RETURN_LAST
set_comp_func ::= BUILD_SET_0 LOAD_FAST FOR_ITER store comp_iter
JUMP_BACK RETURN_VALUE_LAMBDA LAMBDA_MARKER
set_comp_func ::= BUILD_SET_0 LOAD_ARG FOR_ITER store comp_iter
COME_FROM JUMP_BACK RETURN_VALUE RETURN_LAST
set_comp_func ::= BUILD_SET_0 LOAD_ARG FOR_ITER store comp_iter
COME_FROM JUMP_BACK RETURN_VALUE_LAMBDA LAMBDA_MARKER
comp_body ::= dict_comp_body
comp_body ::= set_comp_body
@ -101,6 +109,12 @@ class Python3Parser(PythonParser):
stmt ::= dict_comp_func
dict_comp_func ::= BUILD_MAP_0 LOAD_ARG FOR_ITER store
comp_iter JUMP_BACK RETURN_VALUE RETURN_LAST
dict_comp_func ::= BUILD_MAP_0 LOAD_ARG FOR_ITER store
comp_iter JUMP_BACK RETURN_VALUE_LAMBDA LAMBDA_MARKER
dict_comp_func ::= BUILD_MAP_0 LOAD_FAST FOR_ITER store
comp_iter JUMP_BACK RETURN_VALUE RETURN_LAST
dict_comp_func ::= BUILD_MAP_0 LOAD_FAST FOR_ITER store
comp_iter JUMP_BACK RETURN_VALUE_LAMBDA LAMBDA_MARKER
comp_iter ::= comp_if_not
comp_if_not ::= expr jmp_true comp_iter

View File

@ -77,11 +77,11 @@ class Python30Parser(Python31Parser):
set_comp_func ::= set_comp_header
LOAD_ARG FOR_ITER store comp_iter
JUMP_BACK COME_FROM POP_TOP JUMP_BACK
JUMP_BACK
RETURN_VALUE RETURN_LAST
set_comp_func ::= set_comp_header
LOAD_ARG FOR_ITER store comp_iter
JUMP_BACK COME_FROM POP_TOP JUMP_BACK
JUMP_BACK
RETURN_VALUE_LAMBDA LAMBDA_MARKER
list_comp_header ::= BUILD_LIST_0 DUP_TOP STORE_FAST