You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Interval order COME_FROMs in Python3
This bug had possibly caused lots of grammar pollution which may need addressing. We want to process COME_FROMs to the same offset to be in *descending* order so we have the larger range or biggest instruction interval last. (I think they are sorted in increasing order, but for safety we sort them). That way, specific COME_FROM tags will match up properly. For example, a "loop" with an "if" nested in it should have the "loop" tag last so the grammar rule matches that properly Adjust Python 3 grammar for more COME_FROM -> COME_FROM_LOOP. And remove optional COME_FROM_LOOP where possible. Previously, the optional-ness was a result of inner nestings gobbling up the COME_FROM. We'll probably want to go back and fix this up in Python2.
This commit is contained in:
@@ -94,27 +94,6 @@ class Python2Parser(PythonParser):
|
||||
|
||||
stmt ::= exec_stmt
|
||||
|
||||
stmt ::= assert
|
||||
stmt ::= assert2
|
||||
stmt ::= ifstmt
|
||||
stmt ::= ifelsestmt
|
||||
|
||||
stmt ::= whilestmt
|
||||
stmt ::= while1stmt
|
||||
stmt ::= whileelsestmt
|
||||
stmt ::= while1elsestmt
|
||||
stmt ::= forstmt
|
||||
stmt ::= forelsestmt
|
||||
stmt ::= trystmt
|
||||
stmt ::= tryelsestmt
|
||||
stmt ::= tryfinallystmt
|
||||
stmt ::= withstmt
|
||||
stmt ::= withasstmt
|
||||
|
||||
stmt ::= del_stmt
|
||||
del_stmt ::= DELETE_FAST
|
||||
del_stmt ::= DELETE_NAME
|
||||
del_stmt ::= DELETE_GLOBAL
|
||||
del_stmt ::= expr DELETE_SLICE+0
|
||||
del_stmt ::= expr expr DELETE_SLICE+1
|
||||
del_stmt ::= expr expr DELETE_SLICE+2
|
||||
|
Reference in New Issue
Block a user