RootSource

class RootSource(inputRef: InputString, val offset: Int, val nestLevel: Int) extends SourceCursor

A root source represents the full input string of a parsing operation.

In a single-pass parser like those for HOCON or CSS, only RootCursor instances will be used for the entire parsing operation.

In a multi-pass parser like those for text markup, a RootCursor is only used for the first pass, whereas the subsequent passes on parts of the input are performed with the other SourceCursor implementations.

For this reason this type of cursor is only meant to be used for creating a root cursor for the input holding the whole document (e.g. the entire markup document or the full template).

For creating a cursor for a fragment of the input, either BlockSource or LineSource must be used to preserve position tracking in relation to the root input.

class Object
trait Matchable
class Any

Type members

Types

Value members

Concrete methods

def atEnd: Boolean
def capture(numChars: Int): String
def consume(numChars: Int): RootSource
override def equals(obj: Any): Boolean
Definition Classes
Any
override def hashCode(): Int
Definition Classes
Any
def remaining: Int
override def toString: String
Definition Classes
Any

Inherited methods

def char: Char

The character at the current offset.

The character at the current offset.

Inherited from:
SourceCursor
def charAt(relativeOffset: Int): Char

The character at the specified offset, relative from the current offset.

The character at the specified offset, relative from the current offset.

Inherited from:
SourceCursor
def length: Int

The length of the input of this cursor.

The length of the input of this cursor.

Inherited from:
SourceCursor

Concrete fields

val input: String
val nestLevel: Int
val offset: Int
override val path: Option[Path]
lazy val position: Position