Structure detection bugs +

Had borked 3.4 grammar rules in
previous refactor
This commit is contained in:
rocky
2016-07-10 19:06:36 -04:00
parent 9c2f48ca4a
commit 59ba8a65cd
5 changed files with 58 additions and 43 deletions

View File

@@ -40,14 +40,17 @@ class Python3Parser(PythonParser):
# listcomp is a custom Python3 rule
expr ::= listcomp
list_for ::= expr FOR_ITER designator list_iter JUMP_BACK
# Our "continue" heuristic - in two successive JUMP_BACKS, the first
# one may be a continue - sometimes classifies a JUMP_BACK
# as a CONTINUE. The two are kind of the same in a comprehension.
comp_for ::= expr _for designator comp_iter CONTINUE
list_for ::= expr FOR_ITER designator list_iter jb_or_c
jb_or_c ::= JUMP_BACK
jb_or_c ::= CONTINUE
# See also common Python p_list_comprehension
"""
@@ -580,18 +583,6 @@ class Python33Parser(Python3Parser):
yield_from ::= expr expr YIELD_FROM
"""
class Python34Parser(Python3Parser):
def p_34(self, args):
"""
_ifstmts_jump ::= c_stmts_opt JUMP_FORWARD _come_from
# Python 3.3 added yield from. Do it the same way as in
# 3.3
expr ::= yield_from
yield_from ::= expr expr YIELD_FROM
"""
class Python35onParser(Python3Parser):
def p_35on(self, args):
"""