SourcePos

Swift
public struct SourcePos: Hashable, Sendable

extension SourcePos: CustomStringConvertible

A position in an original source file. Only has meaning in the context of a SourceMap.


Topics

Initializers

init(source: Int32, line: Int32, column: Int32, name: Int32?)

Initialize a new SourcePos.

Declaration
Swift
public init(
    source: Int32,
    line: Int32,
    column: Int32,
    name: Int32? = nil)

Properties

var column: Int32

0-based column index into line line.

Declaration
Swift
public let column: Int32

var description: String

A short human-readable description of the position.

Declaration
Swift
public var description: String { get }

var line: Int32

0-based line index into the original source file.

Declaration
Swift
public let line: Int32

var name: Int32?

0-based index into SourceMap.names of any name associated with the mapping segment, or nil if there is none.

Declaration
Swift
public let name: Int32?

var source: Int32

0-based index into SourceMap.sources of the original source.

Declaration
Swift
public let source: Int32