module Language.Haskell.Lexer.Tokens where

-- | Haskell token classifications:
data Token
  = Varid       -- ^ Variable
  | Conid       -- ^ Constructor
  | Varsym      -- ^ Variable operator
  | Consym      -- ^ Constructor operator
  | Reservedid  -- ^ Reserved keyword
  | Reservedop  -- ^ Reserved operator
  | Specialid
  | IntLit      -- ^ Integral numeric literal
  | FloatLit    -- ^ Fractional numeric literal
  | CharLit     -- ^ Character literal
  | StringLit   -- ^ String literal


  | QQuote      -- ^ Quasi quote: @[|text|stuff|]@

  | Qvarid      -- ^ Qualified variable
  | Qconid      -- ^ Qualified constructor
  | Qvarsym     -- ^ Qualified variable operator
  | Qconsym     -- ^ Qualified constructor operator

  | Special
  | Whitespace  -- ^ White space

  | NestedCommentStart  -- ^ Internal: causes a call to an external function
  | NestedComment       -- ^ A nested comment ({- ... -})
  | LiterateComment     -- ^ Not handled by the lexer

  | Commentstart        -- ^ Dashes
  | Comment             -- ^ The stuff after the dashes

  | ErrorToken | GotEOF | TheRest

  | ModuleName | ModuleAlias -- ^ recognized in a later pass

  -- Inserted during layout processing (see Haskell 98, 9.3):
  | Layout     -- ^ for implicit braces
  | Indent Int -- ^ \<n\>, to preceed first token on each line
  | Open Int   -- ^ \{n\}, after let, where, do or of, if not followed by a \"{\"
  deriving (Int -> Token -> ShowS
[Token] -> ShowS
Token -> String
(Int -> Token -> ShowS)
-> (Token -> String) -> ([Token] -> ShowS) -> Show Token
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Token -> ShowS
showsPrec :: Int -> Token -> ShowS
$cshow :: Token -> String
show :: Token -> String
$cshowList :: [Token] -> ShowS
showList :: [Token] -> ShowS
Show,Token -> Token -> Bool
(Token -> Token -> Bool) -> (Token -> Token -> Bool) -> Eq Token
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Token -> Token -> Bool
== :: Token -> Token -> Bool
$c/= :: Token -> Token -> Bool
/= :: Token -> Token -> Bool
Eq,Eq Token
Eq Token =>
(Token -> Token -> Ordering)
-> (Token -> Token -> Bool)
-> (Token -> Token -> Bool)
-> (Token -> Token -> Bool)
-> (Token -> Token -> Bool)
-> (Token -> Token -> Token)
-> (Token -> Token -> Token)
-> Ord Token
Token -> Token -> Bool
Token -> Token -> Ordering
Token -> Token -> Token
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 :: Token -> Token -> Ordering
compare :: Token -> Token -> Ordering
$c< :: Token -> Token -> Bool
< :: Token -> Token -> Bool
$c<= :: Token -> Token -> Bool
<= :: Token -> Token -> Bool
$c> :: Token -> Token -> Bool
> :: Token -> Token -> Bool
$c>= :: Token -> Token -> Bool
>= :: Token -> Token -> Bool
$cmax :: Token -> Token -> Token
max :: Token -> Token -> Token
$cmin :: Token -> Token -> Token
min :: Token -> Token -> Token
Ord)