LexerRange

Range structure that wraps the _lexer's input.

Constructors

this
this(const(ubyte)[] bytes, size_t index, size_t column, size_t line)

Members

Functions

canPeek
bool canPeek(size_t p)
empty
bool empty()

Implements the range primitive empty.

front
ubyte front()

Implements the range primitive front.

incrementLine
void incrementLine(size_t i)

Increments the range's line number and resets the column counter.

mark
size_t mark()
peek
const(ubyte)[] peek(size_t p)
peekAt
ubyte peekAt(size_t offset)
popFront
void popFront()

Implements the range primitive popFront.

popFrontN
void popFrontN(size_t n)

Implements the algorithm popFrontN more efficiently. This function does not detect or handle newlines.

seek
void seek(size_t m)

Sets the range to the given position.

slice
const(ubyte)[] slice(size_t m)

Returs a slice of the input byte array between the given mark and the current position. Params m = the beginning index of the slice to return

startsWith
bool startsWith(const(ubyte[]) needle)

Variables

bytes
const(ubyte)[] bytes;

The input bytes.

column
size_t column;

The current column number.

index
size_t index;

The range's current position.

line
size_t line;

The current line number.

Meta