Largish rework: scan while1stmt for jump out ..

to disambiguate.

For this, we use the self.opc JUMP_OPS sets.
For this, we neeed to store opc in the parse object.

DRY uses of "last = min(last, len(tokens))
This commit is contained in:
rocky
2020-01-23 13:02:29 -05:00
parent 0f4b791502
commit eeb48818f3
6 changed files with 34 additions and 39 deletions

View File

@@ -116,7 +116,7 @@ def ifelsestmt(self, lhs, n, rule, ast, tokens, first, last):
if jf_cf_pop == "jf_cf_pop" and jf_cf_pop[0] == "JUMP_FORWARD":
jump_forward = jf_cf_pop[0]
endif_target = int(jump_forward.pattr)
last_offset = tokens[min(last, n-1)].off2int()
last_offset = tokens[last].off2int()
if endif_target != last_offset:
return True