MCPcopy Index your code
hub / github.com/RustPython/RustPython / lasti2lineno

Function lasti2lineno

Lib/pdb.py:115–121  ·  view source on GitHub ↗
(code, lasti)

Source from the content-addressed store, hash-verified

113 return inspect.getblock(lines[lineno:]), lineno+1
114
115def lasti2lineno(code, lasti):
116 linestarts = list(dis.findlinestarts(code))
117 linestarts.reverse()
118 for i, lineno in linestarts:
119 if lasti >= i:
120 return lineno
121 return 0
122
123
124class _rstr(str):

Callers 1

setupMethod · 0.85

Calls 2

listClass · 0.85
reverseMethod · 0.45

Tested by

no test coverage detected