You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Some grammar cleanup
This commit is contained in:
@@ -85,7 +85,8 @@ Starnberger got the code to where uncompyle2 was around 2012.
|
|||||||
This project, uncompyle6, however owes its existence to the fork of
|
This project, uncompyle6, however owes its existence to the fork of
|
||||||
uncompyle2 by Myst herie (Mysterie) whose first commit seems to goes
|
uncompyle2 by Myst herie (Mysterie) whose first commit seems to goes
|
||||||
back to 2012. I chose this since it seemed to have been at that time
|
back to 2012. I chose this since it seemed to have been at that time
|
||||||
the most actively, if briefly, worked on.
|
the most actively, if briefly, worked on. I also looked at Dark Fenx's
|
||||||
|
uncompyle3 for inspiration for Python3.
|
||||||
|
|
||||||
Over the many years, code styles and Python features have
|
Over the many years, code styles and Python features have
|
||||||
changed. However brilliant the code was and still is, it hasn't really
|
changed. However brilliant the code was and still is, it hasn't really
|
||||||
|
@@ -484,12 +484,11 @@ def get_python_parser(version, debug_parser, compile_mode='exec'):
|
|||||||
return p
|
return p
|
||||||
|
|
||||||
class PythonParserSingle(PythonParser):
|
class PythonParserSingle(PythonParser):
|
||||||
def p_call_stmt(self, args):
|
def p_call_stmt_single(self, args):
|
||||||
'''
|
'''
|
||||||
# single-mode compilation. Eval-mode interactive compilation
|
# single-mode compilation. Eval-mode interactive compilation
|
||||||
# drops the last rule.
|
# drops the last rule.
|
||||||
|
|
||||||
call_stmt ::= expr POP_TOP
|
|
||||||
call_stmt ::= expr PRINT_EXPR
|
call_stmt ::= expr PRINT_EXPR
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
@@ -144,7 +144,6 @@ class Python2Parser(PythonParser):
|
|||||||
|
|
||||||
stmt ::= classdef
|
stmt ::= classdef
|
||||||
stmt ::= call_stmt
|
stmt ::= call_stmt
|
||||||
call_stmt ::= expr POP_TOP
|
|
||||||
|
|
||||||
stmt ::= return_stmt
|
stmt ::= return_stmt
|
||||||
return_stmt ::= ret_expr RETURN_VALUE
|
return_stmt ::= ret_expr RETURN_VALUE
|
||||||
|
@@ -261,7 +261,7 @@ class Python3Parser(PythonParser):
|
|||||||
# COME_FROM targets from the wrong places
|
# COME_FROM targets from the wrong places
|
||||||
|
|
||||||
trystmt ::= SETUP_EXCEPT suite_stmts_opt POP_BLOCK
|
trystmt ::= SETUP_EXCEPT suite_stmts_opt POP_BLOCK
|
||||||
try_middle _come_from _come_from
|
try_middle _come_from
|
||||||
|
|
||||||
# this is nested inside a trystmt
|
# this is nested inside a trystmt
|
||||||
tryfinallystmt ::= SETUP_FINALLY suite_stmts_opt
|
tryfinallystmt ::= SETUP_FINALLY suite_stmts_opt
|
||||||
|
@@ -31,6 +31,8 @@ class Scanner27(scan.Scanner):
|
|||||||
The main part of this procedure is modelled after
|
The main part of this procedure is modelled after
|
||||||
dis.disassemble().
|
dis.disassemble().
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# dis.disassemble(co) # DEBUG
|
||||||
rv = []
|
rv = []
|
||||||
customize = {}
|
customize = {}
|
||||||
Token = self.Token # shortcut
|
Token = self.Token # shortcut
|
||||||
|
Reference in New Issue
Block a user