-----------------------------------------------------------------------------
-- |
-- Module      :  Text.Parser.Token.Highlight
-- Copyright   :  (C) 2011 Edward Kmett
-- License     :  BSD-style (see the file LICENSE)
--
-- Maintainer  :  Edward Kmett <ekmett@gmail.com>
-- Stability   :  experimental
-- Portability :  portable
--
-- Highlighting isn't strictly a parsing concern, but it makes more sense
-- to annotate a parser with highlighting information than to require
-- someone to completely reimplement all of the combinators to add
-- this functionality later when they need it.
--
----------------------------------------------------------------------------
module Text.Parser.Token.Highlight
  ( Highlight(..)
  ) where

-- | Tags used by the 'Text.Parser.Token.TokenParsing' 'Text.Parser.Token.highlight' combinator.
data Highlight
  = EscapeCode
  | Number
  | Comment
  | CharLiteral
  | StringLiteral
  | Constant
  | Statement
  | Special
  | Symbol
  | Identifier
  | ReservedIdentifier
  | Operator
  | ReservedOperator
  | Constructor
  | ReservedConstructor
  | ConstructorOperator
  | ReservedConstructorOperator
  | BadInput
  | Unbound
  | Layout
  | MatchedSymbols
  | LiterateComment
  | LiterateSyntax
  deriving (Highlight -> Highlight -> Bool
(Highlight -> Highlight -> Bool)
-> (Highlight -> Highlight -> Bool) -> Eq Highlight
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Highlight -> Highlight -> Bool
== :: Highlight -> Highlight -> Bool
$c/= :: Highlight -> Highlight -> Bool
/= :: Highlight -> Highlight -> Bool
Eq,Eq Highlight
Eq Highlight =>
(Highlight -> Highlight -> Ordering)
-> (Highlight -> Highlight -> Bool)
-> (Highlight -> Highlight -> Bool)
-> (Highlight -> Highlight -> Bool)
-> (Highlight -> Highlight -> Bool)
-> (Highlight -> Highlight -> Highlight)
-> (Highlight -> Highlight -> Highlight)
-> Ord Highlight
Highlight -> Highlight -> Bool
Highlight -> Highlight -> Ordering
Highlight -> Highlight -> Highlight
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Highlight -> Highlight -> Ordering
compare :: Highlight -> Highlight -> Ordering
$c< :: Highlight -> Highlight -> Bool
< :: Highlight -> Highlight -> Bool
$c<= :: Highlight -> Highlight -> Bool
<= :: Highlight -> Highlight -> Bool
$c> :: Highlight -> Highlight -> Bool
> :: Highlight -> Highlight -> Bool
$c>= :: Highlight -> Highlight -> Bool
>= :: Highlight -> Highlight -> Bool
$cmax :: Highlight -> Highlight -> Highlight
max :: Highlight -> Highlight -> Highlight
$cmin :: Highlight -> Highlight -> Highlight
min :: Highlight -> Highlight -> Highlight
Ord,Int -> Highlight -> ShowS
[Highlight] -> ShowS
Highlight -> String
(Int -> Highlight -> ShowS)
-> (Highlight -> String)
-> ([Highlight] -> ShowS)
-> Show Highlight
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Highlight -> ShowS
showsPrec :: Int -> Highlight -> ShowS
$cshow :: Highlight -> String
show :: Highlight -> String
$cshowList :: [Highlight] -> ShowS
showList :: [Highlight] -> ShowS
Show,ReadPrec [Highlight]
ReadPrec Highlight
Int -> ReadS Highlight
ReadS [Highlight]
(Int -> ReadS Highlight)
-> ReadS [Highlight]
-> ReadPrec Highlight
-> ReadPrec [Highlight]
-> Read Highlight
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Highlight
readsPrec :: Int -> ReadS Highlight
$creadList :: ReadS [Highlight]
readList :: ReadS [Highlight]
$creadPrec :: ReadPrec Highlight
readPrec :: ReadPrec Highlight
$creadListPrec :: ReadPrec [Highlight]
readListPrec :: ReadPrec [Highlight]
Read,Int -> Highlight
Highlight -> Int
Highlight -> [Highlight]
Highlight -> Highlight
Highlight -> Highlight -> [Highlight]
Highlight -> Highlight -> Highlight -> [Highlight]
(Highlight -> Highlight)
-> (Highlight -> Highlight)
-> (Int -> Highlight)
-> (Highlight -> Int)
-> (Highlight -> [Highlight])
-> (Highlight -> Highlight -> [Highlight])
-> (Highlight -> Highlight -> [Highlight])
-> (Highlight -> Highlight -> Highlight -> [Highlight])
-> Enum Highlight
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: Highlight -> Highlight
succ :: Highlight -> Highlight
$cpred :: Highlight -> Highlight
pred :: Highlight -> Highlight
$ctoEnum :: Int -> Highlight
toEnum :: Int -> Highlight
$cfromEnum :: Highlight -> Int
fromEnum :: Highlight -> Int
$cenumFrom :: Highlight -> [Highlight]
enumFrom :: Highlight -> [Highlight]
$cenumFromThen :: Highlight -> Highlight -> [Highlight]
enumFromThen :: Highlight -> Highlight -> [Highlight]
$cenumFromTo :: Highlight -> Highlight -> [Highlight]
enumFromTo :: Highlight -> Highlight -> [Highlight]
$cenumFromThenTo :: Highlight -> Highlight -> Highlight -> [Highlight]
enumFromThenTo :: Highlight -> Highlight -> Highlight -> [Highlight]
Enum,Highlight
Highlight -> Highlight -> Bounded Highlight
forall a. a -> a -> Bounded a
$cminBound :: Highlight
minBound :: Highlight
$cmaxBound :: Highlight
maxBound :: Highlight
Bounded)