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

Function _make_labels_map

Lib/dis.py:850–863  ·  view source on GitHub ↗
(original_code, exception_entries=())

Source from the content-addressed store, hash-verified

848
849
850def _make_labels_map(original_code, exception_entries=()):
851 jump_targets = set(findlabels(original_code))
852 labels = set(jump_targets)
853 for start, end, target, _, _ in exception_entries:
854 labels.add(start)
855 labels.add(end)
856 labels.add(target)
857 labels = sorted(labels)
858 labels_map = {offset: i+1 for (i, offset) in enumerate(sorted(labels))}
859 for e in exception_entries:
860 e.start_label = labels_map[e.start]
861 e.end_label = labels_map[e.end]
862 e.target_label = labels_map[e.target]
863 return labels_map
864
865_NO_LINENO = ' --'
866

Callers 5

disFunction · 0.85
get_instructionsFunction · 0.85
disassembleFunction · 0.85
__iter__Method · 0.85
disMethod · 0.85

Calls 5

setFunction · 0.85
findlabelsFunction · 0.85
sortedFunction · 0.85
enumerateFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected