Remove more 3.0 parse errors...

However this doesn't mean that some wrong rules still don't
kid in. We still have control-flow "if/and/else" vs "if/if/else" problems.
This commit is contained in:
rocky
2019-11-14 18:31:46 -05:00
parent fff6f82dd7
commit 2e36551c02

View File

@@ -258,7 +258,11 @@ class Python30Parser(Python31Parser):
if rule[0] == "iflaststmtl":
return not (jmp_false[0].attr <= tokens[last].offset)
else:
return not (tokens[first].offset <= jmp_false[0].attr <= tokens[last].offset)
jmp_false_target = jmp_false[0].attr
if tokens[first].offset > jmp_false_target:
return True
return (
(jmp_false_target > tokens[last].offset) and tokens[last] != "JUMP_FORWARD")
pass
pass
pass