Some grammar cleanup

This commit is contained in:
rocky
2016-05-09 11:55:38 -04:00
parent 41f9e9e53e
commit 8b9e0eca42
5 changed files with 6 additions and 5 deletions

View File

@@ -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

View File

@@ -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
''' '''

View File

@@ -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

View File

@@ -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

View File

@@ -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