PositionMaker

A modifiable PositionMarker that stores the positions of the line-separators

Since

0.1.0

Constructors

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

Constructor for the PositionMaker

constructor(index: Int, column: Int, line: Int, lineSeparators: IntArray, source: CharacterSource)

Constructor for the PositionMaker

constructor(source: CharacterSource)

Constructor for the PositionMaker

Properties

Link copied to clipboard
open override var column: Int

The column of the position

Link copied to clipboard
open override var index: Int

The index of the position

Link copied to clipboard
open override var line: Int
Link copied to clipboard
open override val lineSeparators: IntArray

The list of line-separators

Link copied to clipboard
open override val location: String

The location of the PositionMaker

Link copied to clipboard
open override val source: CharacterSource

The source of the PositionMaker

Functions

Link copied to clipboard

Creates a Position from the PositionMaker at the actual location. The PositionMap is only working to the actual position

Link copied to clipboard

Creates a PositionMap from the PositionMaker. This function only works after the position is looped through

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
Link copied to clipboard
fun nextLine()

Increases the PositionMaker.index and PositionMaker.line and sets the PositionMaker.column to 1

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

Resolve the Position of a character from its index

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

Returns a string-representation of the PositionMaker