You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Add grammar rule involving RETURN_END_IF
This commit is contained in:
BIN
test/bytecode_3.5/02_for_else_bug.pyc
Normal file
BIN
test/bytecode_3.5/02_for_else_bug.pyc
Normal file
Binary file not shown.
10
test/simple_source/bug35/02_for_else_bug.py
Normal file
10
test/simple_source/bug35/02_for_else_bug.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Adapted 3.5 from _bootstrap_external.py
|
||||||
|
|
||||||
|
|
||||||
|
def spec_from_file_location(loader, location):
|
||||||
|
if loader:
|
||||||
|
for _ in __file__:
|
||||||
|
if location:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
return None
|
@@ -111,6 +111,8 @@ class Python35Parser(Python34Parser):
|
|||||||
return_if_stmt ::= return_expr RETURN_END_IF POP_BLOCK
|
return_if_stmt ::= return_expr RETURN_END_IF POP_BLOCK
|
||||||
return_if_lambda ::= RETURN_END_IF_LAMBDA COME_FROM
|
return_if_lambda ::= RETURN_END_IF_LAMBDA COME_FROM
|
||||||
|
|
||||||
|
return ::= return_expr RETURN_END_IF
|
||||||
|
|
||||||
jb_else ::= JUMP_BACK ELSE
|
jb_else ::= JUMP_BACK ELSE
|
||||||
ifelsestmtc ::= testexpr c_stmts_opt JUMP_FORWARD else_suitec
|
ifelsestmtc ::= testexpr c_stmts_opt JUMP_FORWARD else_suitec
|
||||||
ifelsestmtl ::= testexpr c_stmts_opt jb_else else_suitel
|
ifelsestmtl ::= testexpr c_stmts_opt jb_else else_suitel
|
||||||
|
@@ -431,7 +431,7 @@ TABLE_DIRECT = {
|
|||||||
"mkfuncdeco": ("%|@%c\n%c", (0, "expr"), 1),
|
"mkfuncdeco": ("%|@%c\n%c", (0, "expr"), 1),
|
||||||
# A custom rule in n_function def distinguishes whether to call this or
|
# A custom rule in n_function def distinguishes whether to call this or
|
||||||
# function_def_async
|
# function_def_async
|
||||||
"mkfuncdeco0": ("%|def %c\n", (0, "mkfunc")),
|
"mkfuncdeco0": ("%|def %c\n", (0, ("mkfunc", "mkfunc_annotate"))),
|
||||||
|
|
||||||
# In cases where we desire an explict new line.
|
# In cases where we desire an explict new line.
|
||||||
# After docstrings which are followed by a "def" is
|
# After docstrings which are followed by a "def" is
|
||||||
|
Reference in New Issue
Block a user