You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
Start to narrow 3.7 FUNCTION_EX grammar
This commit is contained in:
@@ -294,20 +294,30 @@ class Python36Parser(Python35Parser):
|
|||||||
call_ex ::= expr starred CALL_FUNCTION_EX
|
call_ex ::= expr starred CALL_FUNCTION_EX
|
||||||
""", nop_func)
|
""", nop_func)
|
||||||
if self.version > 3.6:
|
if self.version > 3.6:
|
||||||
self.addRule("""
|
if 'BUILD_TUPLE_UNPACK_WITH_CALL' in self.seen_ops:
|
||||||
expr ::= call_ex_kw
|
self.addRule("""
|
||||||
expr ::= call_ex_kw3
|
expr ::= call_ex_kw3
|
||||||
expr ::= call_ex_kw4
|
|
||||||
call_ex_kw3 ::= expr
|
call_ex_kw3 ::= expr
|
||||||
build_tuple_unpack_with_call
|
build_tuple_unpack_with_call
|
||||||
expr
|
%s
|
||||||
CALL_FUNCTION_EX
|
CALL_FUNCTION_EX
|
||||||
|
""" % 'expr '* token.attr, nop_func)
|
||||||
|
elif 'BUILD_MAP_UNPACK_WITH_CALL' in self.seen_ops:
|
||||||
|
# FIXME: Is this right?
|
||||||
|
self.addRule("""
|
||||||
|
expr ::= call_ex_kw
|
||||||
|
call_ex_kw ::= expr expr
|
||||||
|
build_map_unpack_with_call CALL_FUNCTION_EX
|
||||||
|
""", nop_func)
|
||||||
|
pass
|
||||||
|
|
||||||
|
# FIXME: Is this right?
|
||||||
|
self.addRule("""
|
||||||
|
expr ::= call_ex_kw4
|
||||||
call_ex_kw4 ::= expr
|
call_ex_kw4 ::= expr
|
||||||
expr
|
expr
|
||||||
expr
|
expr
|
||||||
CALL_FUNCTION_EX
|
CALL_FUNCTION_EX
|
||||||
call_ex_kw ::= expr expr
|
|
||||||
build_map_unpack_with_call CALL_FUNCTION_EX
|
|
||||||
""", nop_func)
|
""", nop_func)
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user