curry-base-1.0.0: Functions for manipulating Curry programs

Copyright(c) Wolfgang Lux
LicenseBSD-3-clause
Maintainerbjp@informatik.uni-kiel.de
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Curry.Base.Position

Contents

Description

This module implements a data type for positions in a source file and respective functions to operate on them. A source file position consists of a filename, a line number, and a column number. A tab stop is assumed at every eighth column.

Synopsis

Source code position

data Position Source #

Source code positions

Constructors

Position

Normal source code position

Fields

NoPos

no position

(@>) :: (HasPosition a, HasPosition b) => a -> b -> a Source #

x @> y returns x with the position obtained from y

ppPosition :: Position -> Doc Source #

Pretty print a Position

ppLine :: Position -> Doc Source #

Pretty print the line and column of a Position

showLine :: Position -> String Source #

Show the line and column of a Position

first :: FilePath -> Position Source #

Absolute first position of a file

next :: Position -> Position Source #

Next position to the right

incr :: Position -> Int -> Position Source #

Increment a position by a number of columns

tab :: Position -> Position Source #

First position after the next tabulator

tabWidth :: Int Source #

Number of spaces for a tabulator

nl :: Position -> Position Source #

First position of the next line