language-python-0.1.1: Parsing and pretty printing of Python code.

Portabilityghc
Stabilityexperimental
Maintainerbjpop@csse.unimelb.edu.au

Language.Python.Data.SrcLocation

Contents

Description

Source location information for the Python parser. XXX We will probably move to source spans at some point.

Synopsis

Projection of locations from values

class Location a whereSource

Types which have a source location.

Methods

location :: a -> SrcLocationSource

Project the location from a value.

Instances

Construction

data SrcLocation Source

A location for a syntactic entity from the source code. The location is specified by its filename, and starting row and column.

Constructors

Sloc 
NoLocation 

initialSrcLocation :: String -> SrcLocationSource

Construct the initial source location for a file.

Modification

incColumn :: Int -> SrcLocation -> SrcLocationSource

Increment the column of a location by one.

incLine :: Int -> SrcLocation -> SrcLocationSource

Increment the line number (row) of a location by one.

incTab :: SrcLocation -> SrcLocationSource

Increment the column of a location by one tab stop.