SourceText
class SourceText(val text: String, val id: String? = null, val origin: SourcePosition = SourcePosition(0, 0, 0)) : Source
Immutable source text together with an optional diagnostic identifier.
origin is non-zero for a materialized fragment of a streamed source. The text property then contains only that fragment, while every position returned by this class remains absolute.
val fragment = SourceText("foo\nbar", "fragment", SourcePosition(100, 7, 11))
check(fragment.positionAt(104) == SourcePosition(104, 8, 0))Content copied to clipboard