parsley-core-2.3.0.0: A fast parser combinator library backed by Typed Template Haskell
LicenseBSD-3-Clause
MaintainerJamie Willis
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Parsley.Internal.Backend.Machine.Types.Input

Description

Exposes abstractions for working with combined offset and position information. Input is used for static augmented information, and Input# is a raw combination of the two components.

Since: 1.8.0.0

Synopsis

Documentation

data Input o Source #

Packages known static information about offsets (via Offset) with static information about positions (currently unavailable).

Since: 2.1.0.0

data Input# o Source #

Packages a dynamic offset with a dynamic position.

Since: 1.8.0.0

Constructors

Input# 

Fields

mkInput :: StaRep o -> (Word, Word) -> Input o Source #

Constructs an Input given a dynamic offset and a static position.

Since: 2.1.0.0

fromInput :: forall o. DynOps o => Input o -> Input# o Source #

Strips away static information, returning the raw dynamic components.

Since: 1.8.0.0

toInput :: forall o. DynOps o => Word -> Input# o -> Input o Source #

Given a unique identifier, forms a plainly annotated static combination of position and offset.

Since: 1.8.0.0

forcePos :: Input o -> PosSelector -> (Code Int -> Input o -> Code r) -> Code r Source #

Collapse the position stored inside the input applying all updates to it. Once this has been completed, the given PosSelector will be used to extract one of the line or column and return it to the given continuation, along with the updated input post-collapse.

Since: 2.1.0.0

updatePos :: Input o -> Code Char -> CharPred -> Input o Source #

Updates the position within the Input when a character has been consumed, providing it the dynamic character that was produced as well as the static character-predicate that guarded it.

Since: 2.1.0.0

chooseInput :: forall o. DynOps o => InputCharacteristic -> Word -> Input o -> Input# o -> Input o Source #

Given knowledge about how input has been consumed through a call boundary, this function can update the input using statically acquired knowledge.

Since: 2.1.0.0