MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / findlinestarts

Function findlinestarts

tools/python-3.11.9-amd64/Lib/dis.py:639–649  ·  view source on GitHub ↗

Find the offsets in a byte code which are start of lines in the source. Generate pairs (offset, lineno)

(code)

Source from the content-addressed store, hash-verified

637 return labels
638
639def findlinestarts(code):
640 """Find the offsets in a byte code which are start of lines in the source.
641
642 Generate pairs (offset, lineno)
643 """
644 lastline = None
645 for start, end, line in code.co_lines():
646 if line is not None and line != lastline:
647 lastline = line
648 yield start, line
649 return
650
651def _find_imports(co):
652 """Find import statements in the code

Callers 3

get_instructionsFunction · 0.85
disassembleFunction · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected