You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
localize 2 and 3 argument BUILD_SLICE...
Nontermninal name matches AST anme now. Add test.
This commit is contained in:
@@ -738,6 +738,18 @@ class Python3Parser(PythonParser):
|
||||
self.custom_classfunc_rule(opname, token, customize,
|
||||
seen_LOAD_BUILD_CLASS,
|
||||
seen_GET_AWAITABLE_YIELD_FROM)
|
||||
elif opname_base == 'BUILD_SLICE':
|
||||
if token.attr == 2:
|
||||
self.add_unique_rules([
|
||||
'expr ::= slice2',
|
||||
'slice2 ::= expr expr BUILD_SLICE_2'
|
||||
], customize)
|
||||
else:
|
||||
assert token.attr == 3, "BUILD_SLICE value must be 2 or 3; is %s" % v
|
||||
self.add_unique_rules([
|
||||
'expr ::= slice3',
|
||||
'slice3 ::= expr expr expr BUILD_SLICE_3',
|
||||
], customize)
|
||||
elif opname_base == 'CALL_METHOD':
|
||||
# PyPy only - DRY with parse2
|
||||
|
||||
|
Reference in New Issue
Block a user