Header menu logo XParsec.ActiveParsers

Cursor<'T, 'State, 'Input> Type

An immutable view of a Reader{T,S,I} at a fixed Position{S}.

A Reader is a mutable cursor, but the arms of an F# match must all start from the same input. Active parsers therefore take a Cursor and, on success, return the value they parsed together with the Cursor after it. A failed pattern leaves its input untouched, so nested and alternative patterns backtrack safely, the same way <|> does.

The position includes the user state, so state changes made by a pattern that does not match are rolled back too.

Record fields

Record Field Description

Position

Full Usage: Position

Field type: Position<'State>
Field type: Position<'State>

Reader

Full Usage: Reader

Field type: Reader<'T, 'State, 'Input>
Field type: Reader<'T, 'State, 'Input>

Instance members

Instance member Description

this.Advance

Full Usage: this.Advance

Parameters:
    count : int

Returns: Cursor<'T, 'State, 'Input>

The cursor items further on. Does not check the bounds of the input.

count : int
Returns: Cursor<'T, 'State, 'Input>

this.AtEnd

Full Usage: this.AtEnd

Returns: bool

True when the cursor is at the end of the input.

Returns: bool

this.Index

Full Usage: this.Index

Returns: int

The index of the cursor in the input.

Returns: int

this.Peek

Full Usage: this.Peek

Returns: 'T voption

The item at the cursor, or ValueNone at the end of the input.

Returns: 'T voption

this.State

Full Usage: this.State

Returns: 'State

The user state at the cursor.

Returns: 'State

Type something to start searching.