You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
NT continue_stmt -> continue to match AST
This commit is contained in:
@@ -65,11 +65,11 @@ class Python2Parser(PythonParser):
|
||||
stmt ::= break_stmt
|
||||
break_stmt ::= BREAK_LOOP
|
||||
|
||||
stmt ::= continue_stmt
|
||||
continue_stmt ::= CONTINUE
|
||||
continue_stmts ::= _stmts lastl_stmt continue_stmt
|
||||
continue_stmts ::= lastl_stmt continue_stmt
|
||||
continue_stmts ::= continue_stmt
|
||||
stmt ::= continue
|
||||
continue ::= CONTINUE
|
||||
continues ::= _stmts lastl_stmt continue
|
||||
continues ::= lastl_stmt continue
|
||||
continues ::= continue
|
||||
|
||||
stmt ::= assert2
|
||||
stmt ::= raise_stmt0
|
||||
@@ -339,7 +339,7 @@ class Python2Parser(PythonParser):
|
||||
rule = 'call ::= expr ' + 'expr '*args_pos + 'kwarg '*args_kw \
|
||||
+ 'expr ' * nak + opname
|
||||
elif opname == 'CONTINUE_LOOP':
|
||||
self.add_unique_rule('continue_stmt ::= CONTINUE_LOOP',
|
||||
self.add_unique_rule('continue ::= CONTINUE_LOOP',
|
||||
opname, v, customize)
|
||||
continue
|
||||
elif opname_base in ('DUP_TOPX', 'RAISE_VARARGS'):
|
||||
|
@@ -91,12 +91,12 @@ class Python3Parser(PythonParser):
|
||||
stmt ::= break_stmt
|
||||
break_stmt ::= BREAK_LOOP
|
||||
|
||||
stmt ::= continue_stmt
|
||||
continue_stmt ::= CONTINUE
|
||||
continue_stmt ::= CONTINUE_LOOP
|
||||
continue_stmts ::= _stmts lastl_stmt continue_stmt
|
||||
continue_stmts ::= lastl_stmt continue_stmt
|
||||
continue_stmts ::= continue_stmt
|
||||
stmt ::= continue
|
||||
continue ::= CONTINUE
|
||||
continue ::= CONTINUE_LOOP
|
||||
continues ::= _stmts lastl_stmt continue
|
||||
continues ::= lastl_stmt continue
|
||||
continues ::= continue
|
||||
|
||||
del_stmt ::= delete_subscr
|
||||
delete_subscr ::= expr expr DELETE_SUBSCR
|
||||
|
@@ -20,7 +20,7 @@ def checker(ast, in_loop, errors):
|
||||
errors.append(error_text)
|
||||
|
||||
for node in ast:
|
||||
if not in_loop and node.kind in ('continue_stmt', 'break_stmt'):
|
||||
if not in_loop and node.kind in ('continue', 'break_stmt'):
|
||||
text = str(node)
|
||||
error_text = '\n# not in loop:\n#\t' + '\n# '.join(text.split("\n"))
|
||||
errors.append(error_text)
|
||||
|
@@ -225,7 +225,7 @@ TABLE_DIRECT = {
|
||||
|
||||
'call_stmt': ( '%|%p\n', (0, 200)),
|
||||
'break_stmt': ( '%|break\n', ),
|
||||
'continue_stmt': ( '%|continue\n', ),
|
||||
'continue': ( '%|continue\n', ),
|
||||
|
||||
'raise_stmt0': ( '%|raise\n', ),
|
||||
'raise_stmt1': ( '%|raise %c\n', 0),
|
||||
|
@@ -85,7 +85,7 @@ ExtractInfo = namedtuple("ExtractInfo",
|
||||
|
||||
TABLE_DIRECT_FRAGMENT = {
|
||||
'break_stmt': ( '%|%rbreak\n', ),
|
||||
'continue_stmt': ( '%|%rcontinue\n', ),
|
||||
'continue ': ( '%|%rcontinue\n', ),
|
||||
'passstmt': ( '%|%rpass\n', ),
|
||||
'raise_stmt0': ( '%|%rraise\n', ),
|
||||
'import': ( '%|import %c%x\n', 2, (2, (0, 1)), ),
|
||||
|
Reference in New Issue
Block a user