SourceRange

data class SourceRange(start: SourcePosition, end: SourcePosition)

Denotes a nonempty set of consecutive characters in a source file. Empty ranges are not allowed, since there is no column number that corresponds to a single position.

Parameters

start

position that comes just before the characters in the range

end

position that comes just after the characters in the range

Constructors

SourceRange
Link copied to clipboard
fun SourceRange(start: SourcePosition, end: SourcePosition)

Functions

merge
Link copied to clipboard
fun merge(that: SourceRange): SourceRange

Combines two ranges to create a range that spans both.

showInSource
Link copied to clipboard
fun showInSource(highlightStyle: Style, contextLines: Int = if (start.line == end.line) 0 else 1): Document

Displays the portions of the source file containing this location and highlights the region corresponding to this location.

toString
Link copied to clipboard
open override fun toString(): String

Properties

end
Link copied to clipboard
val end: SourcePosition
sourcePath
Link copied to clipboard
val sourcePath: String

Description of where the source file came from.

start
Link copied to clipboard
val start: SourcePosition