2.4 tolerance

This commit is contained in:
rocky
2017-12-14 08:45:13 -05:00
parent e47568e147
commit 1856e09a0c
2 changed files with 3 additions and 5 deletions

View File

@@ -128,9 +128,9 @@ class Python36Parser(Python35Parser):
if opname.startswith('CALL_FUNCTION_KW'): if opname.startswith('CALL_FUNCTION_KW'):
self.addRule("expr ::= call_kw", nop_func) self.addRule("expr ::= call_kw", nop_func)
values = 'expr ' * token.attr values = 'expr ' * token.attr
rule = 'call_kw ::= expr kwargs_36 {token.kind}'.format(**locals()) rule = 'call_kw ::= expr kwargs_36 %s' % token.kind
self.addRule(rule, nop_func) self.addRule(rule, nop_func)
rule = 'kwargs_36 ::= {values} LOAD_CONST'.format(**locals()) rule = 'kwargs_36 ::= %s LOAD_CONST' % values
self.add_unique_rule(rule, token.kind, token.attr, customize) self.add_unique_rule(rule, token.kind, token.attr, customize)
elif opname == 'CALL_FUNCTION_EX_KW': elif opname == 'CALL_FUNCTION_EX_KW':
self.addRule("""expr ::= call_ex_kw self.addRule("""expr ::= call_ex_kw

View File

@@ -11,8 +11,6 @@ scanner routine for Python 3.
from uncompyle6.scanners.scanner3 import Scanner3 from uncompyle6.scanners.scanner3 import Scanner3
import xdis
# bytecode verification, verify(), uses JUMP_OPS from here # bytecode verification, verify(), uses JUMP_OPS from here
from xdis.opcodes import opcode_36 as opc from xdis.opcodes import opcode_36 as opc
JUMP_OPS = opc.JUMP_OPS JUMP_OPS = opc.JUMP_OPS
@@ -32,7 +30,7 @@ class Scanner36(Scanner3):
t.kind = 'CALL_FUNCTION_EX_KW' t.kind = 'CALL_FUNCTION_EX_KW'
pass pass
elif t.op == self.opc.CALL_FUNCTION_KW: elif t.op == self.opc.CALL_FUNCTION_KW:
t.kind = 'CALL_FUNCTION_KW_{t.attr}'.format(**locals()) t.kind = 'CALL_FUNCTION_KW_%s' % t.attr
elif t.op == self.opc.BUILD_MAP_UNPACK_WITH_CALL: elif t.op == self.opc.BUILD_MAP_UNPACK_WITH_CALL:
t.kind = 'BUILD_MAP_UNPACK_WITH_CALL_%d' % t.attr t.kind = 'BUILD_MAP_UNPACK_WITH_CALL_%d' % t.attr
pass pass