Point

data class Point(val line: Int, val column: Int) : Comparable<Point> , Serializable

A location in a source code file. The line should be in 1..n, the column in 0..n.

Consider a file with one line, containing text "HELLO":

  • the point before the first character will be Point(1, 0)

  • the point at the end of the first line, after the letter "O" will be Point(1, 5)

Constructors

Link copied to clipboard
constructor(line: Int, column: Int)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open operator override fun compareTo(other: Point): Int
Link copied to clipboard
fun isBefore(other: Point): Boolean

Computes whether this point comes strictly before another point.

Link copied to clipboard

Computes whether this point is the same as, or comes after, another point.

Link copied to clipboard

Computes whether this point is the same as, or comes before, another point.

Link copied to clipboard
fun offset(code: String): Int

Translate the Point to an offset in the original code stream.

Link copied to clipboard
operator fun plus(length: Int): Point
operator fun plus(text: String): Point
Link copied to clipboard
fun rangeWithLength(length: Int): Range
Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
Link copied to clipboard
val column: Int
Link copied to clipboard
val line: Int