-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | A fully compliant Haskell 98 lexer
--   
--   A fully compliant Haskell 98 lexer.
@package haskell-lexer
@version 1.2.1

module Language.Haskell.Lexer
type PosToken = (Token, (Pos, String))

-- | Haskell token classifications:
data Token

-- | Variable
Varid :: Token

-- | Constructor
Conid :: Token

-- | Variable operator
Varsym :: Token

-- | Constructor operator
Consym :: Token

-- | Reserved keyword
Reservedid :: Token

-- | Reserved operator
Reservedop :: Token
Specialid :: Token

-- | Integral numeric literal
IntLit :: Token

-- | Fractional numeric literal
FloatLit :: Token

-- | Character literal
CharLit :: Token

-- | String literal
StringLit :: Token

-- | Quasi quote: [|text|stuff|]
QQuote :: Token

-- | Qualified variable
Qvarid :: Token

-- | Qualified constructor
Qconid :: Token

-- | Qualified variable operator
Qvarsym :: Token

-- | Qualified constructor operator
Qconsym :: Token
Special :: Token

-- | White space
Whitespace :: Token

-- | Internal: causes a call to an external function
NestedCommentStart :: Token

-- | A nested comment ({- ... -})
NestedComment :: Token

-- | Not handled by the lexer
LiterateComment :: Token

-- | Dashes
Commentstart :: Token

-- | The stuff after the dashes
Comment :: Token
ErrorToken :: Token
GotEOF :: Token
TheRest :: Token
ModuleName :: Token

-- | recognized in a later pass
ModuleAlias :: Token

-- | for implicit braces
Layout :: Token

-- | <n>, to preceed first token on each line
Indent :: Int -> Token

-- | {n}, after let, where, do or of, if not followed by a "{"
Open :: Int -> Token

-- | Tokenize and add position information. Preserves white space, and does
--   not insert extra tokens due to layout.
lexerPass0 :: String -> [PosToken]

-- | Same as lexerPass0, except that it uses the given start
--   position.
lexerPass0' :: Pos -> String -> [PosToken]

-- | The function lexerPass1 handles the part of lexical analysis
--   that can be done independently of the parser---the tokenization and
--   the addition of the extra layout tokens <n> and {n}, as
--   specified in section 9.3 of the revised Haskell 98 Report.
lexerPass1 :: String -> [PosToken]

-- | Remove token that are not meaningful (e.g., white space and comments).
rmSpace :: [PosToken] -> [PosToken]

-- | This is an implementation of Haskell layout, as specified in section
--   9.3 of the revised Haskell 98 report. This preprocessor inserts the
--   extra <n> and {n} tokens.
layoutPre :: [PosToken] -> [PosToken]

-- | The posisiotn within a file.
data Pos
Pos :: !Int -> !Int -> !Int -> Pos
[char] :: Pos -> !Int
[line] :: Pos -> !Int
[column] :: Pos -> !Int

-- | The line and column numbers of a position.
simpPos :: Pos -> (Int, Int)

-- | The first column is designated column 1, not 0.
startPos :: Pos

-- | Advance position by a string.
nextPos :: Pos -> String -> Pos

-- | Advance position by a single character.
nextPos1 :: Pos -> Char -> Pos
