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

Function getUpdatedLineNumber

packages/utils/src/bitauth-script.ts:171–178  ·  view source on GitHub ↗
(currentLineNumber: number, insertion: Insertion, opcodeIndex: number)

Source from the content-addressed store, hash-verified

169}
170
171const getUpdatedLineNumber = (currentLineNumber: number, insertion: Insertion, opcodeIndex: number): number => {
172 const newLineNumber = insertion.insertAfterLine + 1;
173 const inTagRange = opcodeIndex >= insertion.startIndex && opcodeIndex <= insertion.endIndex;
174
175 if (inTagRange) return newLineNumber;
176 if (currentLineNumber > insertion.insertAfterLine) return currentLineNumber + 1;
177 return currentLineNumber;
178};
179
180// e.g. ">>> for-loop update (i = i + 1)"
181function tagDescription(tag: SourceTagEntry, locationData: FullLocationData, sourceLines: string[]): string {

Callers 1

updateLocationDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected