Copyright | (c) 2016 Jan Tikovsky 2016 Finn Teegen |
---|---|
License | BSD-3-clause |
Maintainer | jrt@informatik.uni-kiel.de |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
This module implements a data type for span information in a source file and respective functions to operate on them. A source file span consists of a filename, a start position and an end position.
In addition, the type SrcRef
identifies the path to an expression in
the abstract syntax tree by argument positions, which is used for
debugging purposes.
Synopsis
- data Span
- showSpan :: Span -> String
- ppSpan :: Span -> Doc
- ppPositions :: Span -> Doc
- fstSpan :: FilePath -> Span
- startCol :: Span -> Int
- nextSpan :: Span -> Span
- incrSpan :: Span -> Int -> Span
- span2Pos :: Span -> Position
- combineSpans :: Span -> Span -> Span
- tabSpan :: Span -> Span
- nlSpan :: Span -> Span
- addSpan :: Span -> (a, [Span]) -> (a, [Span])
- type Distance = (Int, Int)
- setDistance :: Span -> Distance -> Span
- moveBy :: Position -> Distance -> Position
Documentation
span2Pos :: Span -> Position Source #
Convert a span to a (start) position TODO: This function should be removed as soon as positions are completely replaced by spans in the frontend
type Distance = (Int, Int) Source #
Distance of a span, i.e. the line and column distance between start and end position