Portability | ghc |
---|---|
Stability | experimental |
Maintainer | jwlato@gmail.com |
Safe Haskell | None |
Source code position
- data Position
- = Position {
- posOffset' :: !Int
- posFile' :: String
- posRow' :: !Int
- posColumn' :: !Int
- | NoPosition
- | BuiltinPosition
- | InternalPosition
- = Position {
- position :: Int -> String -> Int -> Int -> Position
- data PosLength = PL !Position !Int
- mkPosLength :: Position -> Int -> PosLength
- unPosLength :: PosLength -> (Position, Int)
- posFile :: Position -> String
- posRow :: Position -> Int
- posColumn :: Position -> Int
- posOffset :: Position -> Int
- initPos :: FilePath -> Position
- isSourcePos :: Position -> Bool
- nopos :: Position
- isNoPos :: Position -> Bool
- builtinPos :: Position
- isBuiltinPos :: Position -> Bool
- internalPos :: Position
- isInternalPos :: Position -> Bool
- incPos :: Position -> Int -> Position
- retPos :: Position -> Position
- adjustPos :: FilePath -> Int -> Position -> Position
- incOffset :: Position -> Int -> Position
- class Pos a where
Documentation
uniform representation of source file positions
Position | |
| |
NoPosition | |
BuiltinPosition | |
InternalPosition |
position :: Int -> String -> Int -> Int -> PositionSource
position absoluteOffset fileName lineNumber columnNumber
initializes a Position
using the given arguments
Position and length of a token
mkPosLength :: Position -> Int -> PosLengthSource
unPosLength :: PosLength -> (Position, Int)Source
posColumn :: Position -> IntSource
Deprecated: column number information is inaccurate in presence of macros - do not rely on it.
initPos :: FilePath -> PositionSource
initialize a Position to the start of the translation unit starting in the given file
isSourcePos :: Position -> BoolSource
returns True
if the given position refers to an actual source file
position attached to built-in objects
isBuiltinPos :: Position -> BoolSource
returns True
if the given position refers to a builtin definition
position used for internal errors
isInternalPos :: Position -> BoolSource
returns True
if the given position is internal
adjustPos :: FilePath -> Int -> Position -> PositionSource
adjust position: change file and line number, reseting column to 1. This is usually
used for #LINE pragmas. The absolute offset is not changed - this can be done
by adjustPos newFile line . incPos (length pragma)
.
class of type which aggregate a source code location