MCPcopy Create free account
hub / github.com/CashScript/cashscript / buildLineToAsmMap

Function buildLineToAsmMap

packages/utils/src/bitauth-script.ts:26–32  ·  view source on GitHub ↗
(bytecode: Script, sourceMapOrLocationData: string | FullLocationData)

Source from the content-addressed store, hash-verified

24}
25
26export function buildLineToAsmMap(bytecode: Script, sourceMapOrLocationData: string | FullLocationData): LineToAsmMap {
27 const lineToOpcodesMap = buildLineToOpcodesMap(bytecode, sourceMapOrLocationData);
28
29 return Object.fromEntries(
30 Object.entries(lineToOpcodesMap).map(([lineNumber, opcodeList]) => [lineNumber, scriptToBitAuthAsm(opcodeList)]),
31 );
32}
33
34export function formatBitAuthScript(bytecode: Script, sourceMap: string, sourceCode: string, sourceTags?: string): string {
35 const locationData = sourceMapToLocationData(sourceMap);

Callers 3

Location.test.tsFile · 0.90
formatBitAuthScriptFunction · 0.85

Calls 2

buildLineToOpcodesMapFunction · 0.85
scriptToBitAuthAsmFunction · 0.85

Tested by

no test coverage detected