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.Pos

Description

This module contains the machinery for manipulating position information, both in static and dynamic forms.

Since: 2.1.0.0

Synopsis

Documentation

data StaPos Source #

Type that represents static positions and their associated data.

Since: 2.1.0.0

type DynPos = Code Pos Source #

The type-alias for dynamic positions.

Since: 2.1.0.0

fromDynPos :: DynPos -> StaPos Source #

Converts a dynamic position into an unannotated static one.

Since: 2.1.0.0

toDynPos :: StaPos -> DynPos Source #

Forgets the static information found in a position and converts it into a dynamic one.

Since: 2.1.0.0

fromStaPos :: (Word, Word) -> StaPos Source #

Produce a static position from a given line and column pair.

Since: 2.1.0.0

force :: StaPos -> PosSelector -> (Code Int -> StaPos -> Code r) -> Code r Source #

Given a static position, and a component to select, collapse the position down to its smallest form (binding this to a let if necessary) and extract the desired component. The new, potentially rebound, position is provided to the continuation too.

Since: 2.1.0.0

update :: StaPos -> Code Char -> CharPred -> StaPos Source #

Advance a static position accounting for the dynamic character that was last read and the static predicate that guarded that read.

Since: 2.1.0.0