cpphsSource codeContentsIndex
Language.Preprocessor.Cpphs.Position
PortabilityAll
Stabilityexperimental
MaintainerMalcolm Wallace <Malcolm.Wallace@cs.york.ac.uk>
Description
Simple file position information, with recursive inclusion points.
Synopsis
data Posn = Pn String !Int !Int (Maybe Posn)
newfile :: String -> Posn
addcol :: Int -> Posn -> Posn
newline :: Posn -> Posn
tab :: Posn -> Posn
newlines :: Int -> Posn -> Posn
newpos :: Int -> Maybe String -> Posn -> Posn
cppline :: Posn -> String
haskline :: Posn -> String
cpp2hask :: String -> String
filename :: Posn -> String
lineno :: Posn -> Int
directory :: Posn -> FilePath
Documentation
data Posn Source
Source positions contain a filename, line, column, and an inclusion point, which is itself another source position, recursively.
Constructors
Pn String !Int !Int (Maybe Posn)
show/hide Instances
newfile :: String -> PosnSource
Constructor. Argument is filename.
addcol :: Int -> Posn -> PosnSource
Increment column number by given quantity.
newline :: Posn -> PosnSource
Increment row number, reset column to 1.
tab :: Posn -> PosnSource
Increment column number, tab stops are every 8 chars.
newlines :: Int -> Posn -> PosnSource
Increment row number by given quantity.
newpos :: Int -> Maybe String -> Posn -> PosnSource
Update position with a new row, and possible filename.
cppline :: Posn -> StringSource
cpp-style printing of file position
haskline :: Posn -> StringSource
haskell-style printing of file position
cpp2hask :: String -> StringSource
Conversion from a cpp-style to haskell-style pragma.
filename :: Posn -> StringSource
Project the filename.
lineno :: Posn -> IntSource
Project the line number.
directory :: Posn -> FilePathSource
Project the directory of the filename.
Produced by Haddock version 2.4.2