luthor-0.0.2: Tools for lexing and utilizing lexemes that integrate with Parsec.

Safe HaskellSafe
LanguageHaskell98

Text.Luthor

Description

Convienience module for users of Luthor.

We export less than Text.Parsec, since many of the modules there can interfere when using other Luthor modules. So, you pay one extra import line in small cases to save compelx imports in larger cases.

One note: Haddock is failing to mention that the lookAhead exported by this module is from Text.Luthor.Combinators, not Text.Parsec.Prim.

Synopsis

Documentation

data ParseError :: *

The abstract data type ParseError represents parse errors. It provides the source position (SourcePos) of the error and a list of error messages (Message). A ParseError can be returned by the function parse. ParseError is an instance of the Show and Eq classes.

errorPos :: ParseError -> SourcePos

Extracts the source position from the parse error

data SourcePos :: *

The abstract data type SourcePos represents source positions. It contains the name of the source (i.e. file name), a line number and a column number. SourcePos is an instance of the Show, Eq and Ord class.

type Line = Int

type Column = Int

sourceName :: SourcePos -> SourceName

Extracts the name of the source from a source position.

sourceLine :: SourcePos -> Line

Extracts the line number from a source position.

sourceColumn :: SourcePos -> Column

Extracts the column number from a source position.