If statement in loop isolation

This commit is contained in:
rocky 2020-01-17 10:47:38 -05:00
parent 4510aa932c
commit b333d7afc2
3 changed files with 17 additions and 13 deletions

View File

@ -35,21 +35,21 @@ for VERSION in $PYVERSIONS ; do
MAX_TESTS=237 # We start failing on "mailbox" at 238
;;
3.2.6 )
MAX_TESTS=800
MAX_TESTS=750 # zipfile fails?
;;
3.3.7 )
MAX_TESTS=800 # We start failing on pkgutil.py
MAX_TESTS=1300 # About 1256 exist
;;
3.4.10 )
MAX_TESTS=800
;;
3.6.9 )
MAX_TESTS=92 # We start failing on cgiltb.py
;;
2.6.9 )
MAX_TESTS=1300
;;
* )
3.6.9 )
MAX_TESTS=900
;;
2.6.9 )
MAX_TESTS=1300
;;
* )
MAX_TESTS=800
;;
esac

View File

@ -52,7 +52,7 @@ class PythonParser(GenericASTBuilder):
# stmts -> stmts stmt -> stmts stmt stmt ...
# collect as stmts -> stmt stmt ...
nt_list = [
'stmts', 'except_stmts', '_stmts', 'attributes',
'stmts', 'except_stmts', '_stmts', 'attributes', "l_stmts",
'exprlist', 'kvlist', 'kwargs', 'come_froms', '_come_froms',
'importlist',
# Python < 3

View File

@ -156,10 +156,10 @@ class Python3Parser(PythonParser):
_ifstmts_jump ::= return_if_stmts
_ifstmts_jump ::= c_stmts_opt come_froms
_ifstmts_jumpl ::= return_if_stmts
_ifstmts_jumpl ::= c_stmts_opt come_froms
iflaststmt ::= testexpr c_stmts_opt JUMP_ABSOLUTE
# ifstmts where we are in a loop
_ifstmts_jumpl ::= _ifstmts_jump
iflaststmtl ::= testexpr c_stmts_opt JUMP_BACK
iflaststmtl ::= testexpr _ifstmts_jumpl
@ -365,6 +365,10 @@ class Python3Parser(PythonParser):
lastc_stmt ::= iflaststmtl
lastc_stmt ::= forelselaststmt
lastc_stmt ::= ifelsestmtc
# Statements in a loop
lstmt ::= stmt
l_stmts ::= lstmt+
"""
def p_loop_stmt3(self, args):