cryptol-2.2.6: Cryptol: The Language of Cryptography

Copyright | (c) 2013-2015 Galois, Inc.
License | BSD3
Maintainer | cryptol@galois.com
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell98

Cryptol.Parser.Position

Description

Synopsis

- data Located a = Located {
  - srcRange :: !Range
  - thing :: a
  }
- data Position = Position {
  - line :: !Int
  - col :: !Int
  }
- data Range = Range {
  - from :: !Position
  - to :: !Position
  - source :: FilePath
  }
- emptyRange :: Range
- start :: Position
- move :: Position -> Char -> Position
- moves :: Position -> String -> Position
- rComb :: Range -> Range -> Range
- rCombs :: [Range] -> Range
- class HasLoc t where
  - getLoc :: t -> Maybe Range
- class HasLoc t => AddLoc t where
  - addLoc :: t -> Range -> t
  - dropLoc :: t -> t
- at :: (HasLoc l, AddLoc t) => l -> t -> t

# Documentation

data Located a Source

Constructors

Located |

Fields

srcRange :: !Range
thing :: a

Instances

Functor Located Source |
Eq a => Eq (Located a) Source |
Show a => Show (Located a) Source |
PP a => PP (Located a) Source |
AddLoc (Located a) Source |
HasLoc (Located a) Source |
NoPos (Located t) Source |
Rename a => Rename (Located a) Source |

data Position Source

Constructors

Position |

Fields

line :: !Int
col :: !Int

Instances

Eq Position Source |
Ord Position Source |
Show Position Source |
PP Position Source |

data Range Source

Constructors

Range |

Fields

from :: !Position
to :: !Position
source :: FilePath

Instances

Eq Range Source |
Show Range Source |
PP Range Source |
HasLoc Range Source |

emptyRange :: Range Source

An empty range.

Caution: using this on the LHS of a use of rComb will cause the empty source to propegate.

start :: Position Source

move :: Position -> Char -> Position Source

moves :: Position -> String -> Position Source

rComb :: Range -> Range -> Range Source

rCombs :: [Range] -> Range Source

class HasLoc t where Source

Methods

getLoc :: t -> Maybe Range Source

Instances

HasLoc Range Source |
HasLoc Prop Source |
HasLoc Type Source |
HasLoc TParam Source |
HasLoc Schema Source |
HasLoc Pattern Source |
HasLoc Match Source |
HasLoc Expr Source |
HasLoc Newtype Source |
HasLoc Bind Source |
HasLoc Decl Source |
HasLoc TopDecl Source |
HasLoc Module Source |
HasLoc a => HasLoc [a] Source |
HasLoc (Located a) Source |
HasLoc a => HasLoc (Named a) Source |
HasLoc a => HasLoc (TopLevel a) Source |
(HasLoc a, HasLoc b) => HasLoc (a, b) Source |

class HasLoc t => AddLoc t where Source

Methods

addLoc :: t -> Range -> t Source

dropLoc :: t -> t Source

Instances

AddLoc Prop Source |
AddLoc Type Source |
AddLoc TParam Source |
AddLoc Schema Source |
AddLoc Pattern Source |
AddLoc Expr Source |
AddLoc Decl Source |
AddLoc (Located a) Source |

at :: (HasLoc l, AddLoc t) => l -> t -> t Source