Section

data class Section(source: Source, index: Int, length: Int)

Represents a span of characters.

Author

An Tran, AdrianTodt

Parameters

source

The section's source.

index

The section's start index.

length

The section's length.

Constructors

Section
Link copied to clipboard
common
fun Section(source: Source, index: Int, length: Int)

Functions

span
Link copied to clipboard
common
fun span(other: Section): Section

Creates a new section which spans across this and another section.

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

Returns a string representation of the section.

Properties

endLineIndex
Link copied to clipboard
common
val endLineIndex: Int

The line index of the end of the section.

endLineNumber
Link copied to clipboard
common
val endLineNumber: Int

The line number of the end of the section.

index
Link copied to clipboard
common
val index: Int
length
Link copied to clipboard
common
val length: Int
lines
Link copied to clipboard
common
val lines: List<Source.Line>

The lines of this section.

range
Link copied to clipboard
common
val range: IntRange

The range of this section.

source
Link copied to clipboard
common
val source: Source
startLineIndex
Link copied to clipboard
common
val startLineIndex: Int

The line index of the start of the section.

startLineNumber
Link copied to clipboard
common
val startLineNumber: Int

The line number of the start of the section.

substring
Link copied to clipboard
common
val substring: String

The substring this section represents.