You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Possibly addresses issue #215
This commit is contained in:
@@ -85,15 +85,17 @@ class Python25Parser(Python26Parser):
|
||||
super(Python25Parser, self).customize_grammar_rules(tokens, customize)
|
||||
if self.version == 2.5:
|
||||
self.check_reduce['try_except'] = 'tokens'
|
||||
self.check_reduce['aug_assign1'] = 'AST'
|
||||
|
||||
## Don't need this for 2.5 yet..
|
||||
# def reduce_is_invalid(self, rule, ast, tokens, first, last):
|
||||
# invalid = super(Python25Parser,
|
||||
# self).reduce_is_invalid(rule, ast,
|
||||
# tokens, first, last)
|
||||
# if invalid or tokens is None:
|
||||
# return invalid
|
||||
# return False
|
||||
def reduce_is_invalid(self, rule, ast, tokens, first, last):
|
||||
invalid = super(Python25Parser,
|
||||
self).reduce_is_invalid(rule, ast,
|
||||
tokens, first, last)
|
||||
if invalid or tokens is None:
|
||||
return invalid
|
||||
if rule == ('aug_assign1', ('expr', 'expr', 'inplace_op', 'store')):
|
||||
return ast[0][0] == 'and'
|
||||
return False
|
||||
|
||||
|
||||
class Python25ParserSingle(Python26Parser, PythonParserSingle):
|
||||
|
@@ -239,6 +239,8 @@ class Python36Parser(Python35Parser):
|
||||
WITH_CLEANUP_START WITH_CLEANUP_FINISH END_FINALLY
|
||||
"""
|
||||
self.addRule(rules_str, nop_func)
|
||||
pass
|
||||
pass
|
||||
|
||||
def custom_classfunc_rule(self, opname, token, customize, next_token):
|
||||
|
||||
@@ -346,6 +348,7 @@ class Python36Parser(Python35Parser):
|
||||
return True
|
||||
nt = nt[0]
|
||||
pass
|
||||
pass
|
||||
return False
|
||||
class Python36ParserSingle(Python36Parser, PythonParserSingle):
|
||||
pass
|
||||
|
Reference in New Issue
Block a user