Copyright | (c) [1995..2000] Manuel M. T. Chakravarty [2008..2009] Benedikt Huber |
---|---|
License | BSD-style |
Maintainer | benedikt.huber@gmail.com |
Stability | experimental |
Portability | ghc |
Safe Haskell | None |
Language | Haskell98 |
Source code position
- data Position
- position :: Int -> String -> Int -> Int -> Position
- type 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 :: Int -> String -> Int -> Int -> Position Source
position absoluteOffset fileName lineNumber columnNumber
initializes a Position
using the given arguments
posColumn :: Position -> Int Source
Deprecated: column number information is inaccurate in presence of macros - do not rely on it.
column in the preprocessed file. Inaccurate w.r.t. to the original file in the presence of preprocessor macros.
initPos :: FilePath -> Position Source
initialize a Position to the start of the translation unit starting in the given file
isSourcePos :: Position -> Bool Source
returns True
if the given position refers to an actual source file
position attached to built-in objects
isBuiltinPos :: Position -> Bool Source
returns True
if the given position refers to a builtin definition
internalPos :: Position Source
position used for internal errors
isInternalPos :: Position -> Bool Source
returns True
if the given position is internal
adjustPos :: FilePath -> Int -> Position -> Position Source
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