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

Parsley.Internal.Backend.Machine.PosOps

Description

This module contains the implementations of updates on positions: these depend on the number of bits in a word, or if the full-width-positions flag was set on the parsley-core library.

Since: 1.8.0.0

Synopsis

Documentation

updatePos :: Code Pos -> Code Char -> Code Pos Source #

Given a position and a character, returns the representation of the updated position.

Since: 1.8.0.0

initPos :: Code Pos Source #

The initial position used by the parser. This is some representation of (1, 1).

Since: 1.8.0.0

updatePos# :: Pos -> Char -> Pos Source #

Updates a given position assuming the given character was read. Tab characters are aligned to the nearest 4th space boundary.

Since: 1.8.0.0

extractLine :: Code Pos -> Code Int Source #

Given the opaque representation of a position, extracts the line number out of it.

Since: 1.8.0.0

extractCol :: Code Pos -> Code Int Source #

Given the opaque representation of a position, extracts the column number out of it.

Since: 1.8.0.0