@tevm/voltaire / primitives/SourceMap
primitives/SourceMap
Type Aliases
SourceMap
SourceMap = object
Defined in: src/primitives/SourceMap/SourceMapType.ts:26
Solidity source map
Semicolon-separated entries mapping bytecode to source locations.
Format: “s:l:f:j:m;s:l:f:j:m;…”
Properties
entries
Defined in: src/primitives/SourceMap/SourceMapType.ts:30 Parsed entriesreadonlyentries: readonlySourceMapEntry[]
raw
Defined in: src/primitives/SourceMap/SourceMapType.ts:28 Raw source map stringreadonlyraw:string
SourceMapEntry
SourceMapEntry = object
Defined in: src/primitives/SourceMap/SourceMapType.ts:7
Solidity source map entry
Maps bytecode positions to source code locations.
Format: s:l:f:j:m (start:length:fileIndex:jump:modifierDepth)
Properties
fileIndex
Defined in: src/primitives/SourceMap/SourceMapType.ts:13 Source file indexreadonlyfileIndex:number
jump
Defined in: src/primitives/SourceMap/SourceMapType.ts:15 Jump type: ‘i’ (into), ‘o’ (out), ’-’ (regular)readonlyjump:"i"|"o"|"-"
length
Defined in: src/primitives/SourceMap/SourceMapType.ts:11 Length in source codereadonlylength:number
modifierDepth?
Defined in: src/primitives/SourceMap/SourceMapType.ts:17 Modifier depth (optional)readonlyoptionalmodifierDepth:number
start
Defined in: src/primitives/SourceMap/SourceMapType.ts:9 Byte offset in source codereadonlystart:number
Functions
from()
from(Defined in: src/primitives/SourceMap/from.js:17 Create SourceMap from source map stringraw):SourceMap
Parameters
raw
string
Source map string (semicolon-separated entries)
Returns
SourceMap
SourceMap
See
- https://voltaire.tevm.sh/primitives/source-map for SourceMap documentation
- https://docs.soliditylang.org/en/latest/internals/source_mappings.html
Since
0.0.0Example
getEntryAt()
getEntryAt(Defined in: src/primitives/SourceMap/getEntryAt.js:14 Get source map entry for specific bytecode positionsourceMap,pc):SourceMapEntry|undefined
Parameters
sourceMap
SourceMap
SourceMap
pc
number
Program counter (bytecode offset)
Returns
SourceMapEntry | undefined
Entry at position
Example
parse()
parse(Defined in: src/primitives/SourceMap/parse.js:17 Parse source map string into entries Solidity source map format: “s:l:f:j:m;s:l:f:j:m;…” Fields can be omitted to inherit from previous entry (compression).raw):SourceMap
Parameters
raw
string
Source map string
Returns
SourceMap
Parsed source map
Example
toEntries()
toEntries(Defined in: src/primitives/SourceMap/toEntries.js:15 Convert source map string to array of entriesraw): readonlySourceMapEntry[]
Parameters
raw
string
Source map string
Returns
readonlySourceMapEntry[]
Parsed entries
Example
toString()
toString(Defined in: src/primitives/SourceMap/toString.js:16 Convert source map to compressed string format Applies compression: omits fields that match previous entry.sourceMap):string
Parameters
sourceMap
SourceMap
SourceMap
Returns
string
Compressed source map string

