PositionMap

interface PositionMap(source)

A PositionMap is a utility that stores the line separators to be able to resolve the Position of a character from its index to save memory

Since

0.1.0

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
open class PositionMapImplementation(val source: CharacterSource, val lineSeparators: IntArray) : PositionMap

Simple implementation of PositionMap

Properties

Link copied to clipboard
abstract val lineSeparators: IntArray

The line separators of the PositionMap

Link copied to clipboard
open val location: String

The location of the PositionMap

Link copied to clipboard

Functions

Link copied to clipboard

Get amount of characters after the Position in the line

open fun getAfterInLine(index: Int): Int

Get amount of characters after the Position in the line Similar to getAfterInLine but with the index of the Position instead of the Position itself

Link copied to clipboard
open fun resolve(index: Int): Position

Resolve the Position of a character from its index