Position

laika.parse.Position
class Position(s: InputString, offset: Int)

Represents an offset into a source string. Its main purpose is error reporting, e.g. printing a visual representation of the line containing the error.

Value parameters

offset

the offset into the source string

s

the source for this position

Attributes

Source
SourceCursor.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def lineContentWithCaret: String

The contents of the line at the current offset, decorated with a caret indicating the column.

The contents of the line at the current offset, decorated with a caret indicating the column. Example:

The content of the current line with a caret under the c.
    ^

Attributes

Source
SourceCursor.scala

Concrete fields

lazy val column: Int

The column number referred to by this position, starting at 1.

The column number referred to by this position, starting at 1.

Attributes

Source
SourceCursor.scala
lazy val line: Int

The line number referred to by this position, starting at 1.

The line number referred to by this position, starting at 1.

Attributes

Source
SourceCursor.scala
lazy val lineContent: String

The contents of the line at the current offset (not including a newline).

The contents of the line at the current offset (not including a newline).

Attributes

Source
SourceCursor.scala
val source: String

Attributes

Source
SourceCursor.scala
lazy override val toString: String

A string representation of this Position of the form line.column.

A string representation of this Position of the form line.column.

Attributes

Source
SourceCursor.scala