MCPcopy
hub / github.com/rocky/python-uncompyle6 / patch_continue

Method patch_continue

uncompyle6/scanners/scanner2.py:1415–1428  ·  view source on GitHub ↗
(self, tokens, offset, op)

Source from the content-addressed store, hash-verified

1413 return targets
1414
1415 def patch_continue(self, tokens, offset, op):
1416 if op in (self.opc.JUMP_FORWARD, self.opc.JUMP_ABSOLUTE):
1417 # FIXME: this is a hack to catch stuff like:
1418 # for ...
1419 # try: ...
1420 # except: continue
1421 # the "continue" is not on a new line.
1422 n = len(tokens)
1423 if (
1424 n > 2
1425 and tokens[-1].kind == "JUMP_BACK"
1426 and self.code[offset + 3] == self.opc.END_FINALLY
1427 ):
1428 tokens[-1].kind = intern("CONTINUE")
1429
1430 # FIXME: combine with scanner3.py code and put into scanner.py
1431 def rem_or(self, start, end, instr, target=None, include_beyond_target=False):

Callers 1

ingestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected