Skip to content

Commit cbcfd53

Browse files
committed
Python 2.6 grammary bug and..
__pkginfo.py__: Bump spark_parser version for parse_flags 'dups'
1 parent df2ca51 commit cbcfd53

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

__pkginfo__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
'pydisassemble=uncompyle6.bin.pydisassemble:main',
3838
]}
3939
ftp_url = None
40-
install_requires = ['spark-parser >= 1.4.0, < 1.5.0',
40+
install_requires = ['spark-parser >= 1.4.3, < 1.5.0',
4141
'xdis >= 3.2.3, < 3.3.0']
4242
license = 'MIT'
4343
mailing_list = 'python-debugger@googlegroups.com'

pytest/test_grammar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ def test_dup_rule():
5959
python_parser(PYTHON_VERSION, inspect.currentframe().f_code,
6060
is_pypy=IS_PYPY,
6161
parser_debug={
62-
'rules': True, 'transition': False, 'reduce': False,
63-
'errorstack': None, 'context': True})
62+
'dups': True, 'transition': False, 'reduce': False,
63+
'rules': False, 'errorstack': None, 'context': True})

uncompyle6/parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,8 @@ def python_parser(version, co, out=sys.stdout, showasm=False,
709709
maybe_show_asm(showasm, tokens)
710710

711711
# For heavy grammar debugging
712-
parser_debug = {'rules': True, 'transition': True, 'reduce' : True,
713-
'showstack': 'full'}
712+
# parser_debug = {'rules': True, 'transition': True, 'reduce' : True,
713+
# 'showstack': 'full'}
714714
p = get_python_parser(version, parser_debug)
715715
return parse(p, tokens, customize)
716716

uncompyle6/parsers/parse26.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def p_jumps26(self, args):
8484
jb_cont ::= CONTINUE
8585
8686
jb_cf_pop ::= JUMP_BACK come_froms POP_TOP
87+
jb_cf_pop ::= JUMP_BACK POP_TOP
8788
ja_cf_pop ::= JUMP_ABSOLUTE come_froms POP_TOP
8889
jf_cf_pop ::= JUMP_FORWARD come_froms POP_TOP
8990
@@ -188,6 +189,8 @@ def p_comp26(self, args):
188189
189190
comp_body ::= gen_comp_body
190191
192+
for_block ::= l_stmts_opt _come_from POP_TOP JUMP_BACK
193+
191194
# Make sure we keep indices the same as 2.7
192195
setup_loop_lf ::= SETUP_LOOP LOAD_FAST
193196
genexpr_func ::= setup_loop_lf FOR_ITER designator comp_iter jb_bp_come_from

0 commit comments

Comments
 (0)