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

@@ -2440,6 +2440,7 @@ class SourceWalker(GenericASTTraversal, object):
# modularity is broken here
p_insts = self.p.insts
self.p.insts = self.scanner.insts
self.p.opc = self.scanner.opc
ast = python_parser.parse(self.p, tokens, customize)
self.p.insts = p_insts
except (python_parser.ParserError, AssertionError) as e: