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 3.0 gen_comp_body rule.
This commit is contained in:
Binary file not shown.
@@ -18,3 +18,13 @@ def parse_marked_section(fn, i, rawdata, report=1):
|
||||
j = 1
|
||||
fn(rawdata[i: j])
|
||||
return 10
|
||||
|
||||
# From 3.0.1 _abcoll.py
|
||||
# Bug was in genexpr_func which doesn't have a JUMP_BACK but
|
||||
# in its gen_comp_body, we can use COME_FROM in its place.
|
||||
# As above omission of JUMPs is a feature of 3.0 that doesn't
|
||||
# seem to be in later versions (or earlier like 2.6).
|
||||
def __and__(self, other):
|
||||
if not isinstance(other, Iterable):
|
||||
return NotImplemented
|
||||
return self._from_iterable(value for value in other if value in self)
|
||||
|
@@ -119,8 +119,9 @@ class Python30Parser(Python31Parser):
|
||||
call_stmt ::= expr COME_FROM
|
||||
_ifstmts_jump30 ::= c_stmts POP_TOP
|
||||
|
||||
################################################################################
|
||||
gen_comp_body ::= expr YIELD_VALUE COME_FROM POP_TOP
|
||||
|
||||
################################################################################
|
||||
for_block ::= l_stmts_opt _come_froms POP_TOP JUMP_BACK
|
||||
|
||||
except_handler ::= JUMP_FORWARD COME_FROM_EXCEPT except_stmts
|
||||
|
Reference in New Issue
Block a user