Fix 2.6- parsing of "for .. try/else" ...

with "continue"  inside
This commit is contained in:
rocky 2018-01-09 08:36:21 -05:00
parent d66fedb921
commit abcb769fdf
4 changed files with 16 additions and 9 deletions

Binary file not shown.

View File

@ -0,0 +1,14 @@
# 2.6- Try/else in a loop with a continue which
# requires a tryelsestmtc
# From 2.6- test_codecs.py
def test_specific_values(self):
for flags in self:
if flags:
try:
self = 1
except ValueError:
continue
else:
self = 2
self = 3

View File

@ -53,18 +53,9 @@ nn [test_zipfile64.py]=1 # Runs ok but takes 204 seconds
;;
2.6)
SKIP_TESTS=(
[test_cmath.py]=1 # Control flow?
[test_codecs.py]=1 # need to fix tryelse
[test_coercion.py]=1 # Control flow?
[test_decorators.py]=1 # Syntax Error - look at
[test_frozen.py]=1 # Control flow?
[test_ftplib.py]=1 # Control flow?
[test_grp.py]=1 # Long test - might work Control flow?
[test_imp.py]=1
[test_pwd.py]=1 # Long test - might work? Control flow?
[test_queue.py]=1 # Control flow?
[test_re.py]=1 # Probably Control flow?
[test_strftime.py]=1
[test_trace.py]=1 # Line numbers are expected to be different
# .pyenv/versions/2.6.9/lib/python2.6/lib2to3/refactor.pyc
# .pyenv/versions/2.6.9/lib/python2.6/mailbox.pyc

View File

@ -42,6 +42,8 @@ class Python26Parser(Python2Parser):
except_handler else_suite come_froms
tryelsestmtl ::= SETUP_EXCEPT suite_stmts_opt POP_BLOCK
except_handler else_suitel
tryelsestmtc ::= SETUP_EXCEPT suite_stmts_opt POP_BLOCK
except_handler else_suitec
_ifstmts_jump ::= c_stmts_opt JUMP_FORWARD COME_FROM POP_TOP