You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Work around grammar remove rule bug...
And reinstate source to a current 3.3 bug (which we don't detect). But at least it is noted for future work.
This commit is contained in:
@@ -20,6 +20,7 @@ def test_grammar():
|
|||||||
unused_rhs = set(['build_list', 'call_function', 'mkfunc',
|
unused_rhs = set(['build_list', 'call_function', 'mkfunc',
|
||||||
'mklambda',
|
'mklambda',
|
||||||
'unpack',])
|
'unpack',])
|
||||||
|
|
||||||
expect_right_recursive = frozenset([('designList',
|
expect_right_recursive = frozenset([('designList',
|
||||||
('designator', 'DUP_TOP', 'designList'))])
|
('designator', 'DUP_TOP', 'designList'))])
|
||||||
if PYTHON3:
|
if PYTHON3:
|
||||||
@@ -35,6 +36,13 @@ def test_grammar():
|
|||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
expect_lhs.add('kwarg')
|
expect_lhs.add('kwarg')
|
||||||
|
|
||||||
|
# FIXME: grammar remove_rule on
|
||||||
|
# kv3 ::= expr expr STORE_MAP
|
||||||
|
# doesn't currently work in grammar, so we have this extraneous kv3 around.
|
||||||
|
if 3.3 <= PYTHON_VERSION <= 3.4:
|
||||||
|
expect_lhs.add('kv3')
|
||||||
|
|
||||||
assert expect_lhs == set(lhs)
|
assert expect_lhs == set(lhs)
|
||||||
assert unused_rhs == set(rhs)
|
assert unused_rhs == set(rhs)
|
||||||
assert expect_right_recursive == right_recursive
|
assert expect_right_recursive == right_recursive
|
||||||
|
BIN
test/bytecode_3.2/05_while_true_break.pyc
Normal file
BIN
test/bytecode_3.2/05_while_true_break.pyc
Normal file
Binary file not shown.
Binary file not shown.
3
test/simple_source/bug22/01_kv.py
Normal file
3
test/simple_source/bug22/01_kv.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Test of building map via kv rules
|
||||||
|
aa = 'aa'
|
||||||
|
dict0 = {'a': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa','b': 1234,'d': aa,aa: aa}
|
18
test/simple_source/bug32/05_while_true_break.py
Normal file
18
test/simple_source/bug32/05_while_true_break.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# From 3.4 mailbox.py
|
||||||
|
# Bug is not not getting control structure right
|
||||||
|
# specifically the 2nd elif not line
|
||||||
|
def _generate_toc(line):
|
||||||
|
while 1:
|
||||||
|
if line.startswith('2'):
|
||||||
|
line = 5
|
||||||
|
while 1:
|
||||||
|
if line:
|
||||||
|
line = 6
|
||||||
|
break
|
||||||
|
elif not line:
|
||||||
|
line = 7
|
||||||
|
break
|
||||||
|
elif not line:
|
||||||
|
break
|
||||||
|
|
||||||
|
return 1
|
Reference in New Issue
Block a user