Moduleparsec-3.1.18.0Haskell2010
Text.ParserCombinators.Parsec.Pos
Parsec compatibility module
- 4 types
- 12 values
- Packageparsec-3.1.18.0
- Exports16
- LanguageHaskell2010
- LicenceBSD-2-Clause
- SourcePos.hs
Extracts the line number from a source position.
Extracts the column number from a source position.
Extracts the name of the source from a source position.
Increments the line number of a source position.
Increments the column number of a source position.
Set the line number of a source position.
Set the column number of a source position.
Set the name of the source.
Create a new SourcePos with the given source name, line number and column number.
Create a new SourcePos with the given source name, and line number and column number set to 1, the upper left.
Update a source position given a character. If the character is a
newline ('\n') or carriage return ('\r') the line number is
incremented by 1. If the character is a tab ('t') the column
number is incremented to the nearest 8'th column, ie. column + 8 -
((column-1) `mod` 8). In all other cases, the column is
incremented by 1.
The expression updatePosString pos s updates the source position
pos by calling updatePosChar on every character in s, ie.
foldl updatePosChar pos string.