    {-# OPTIONS  #-}
    -----------------------------------------------------------------------------
    -- |
    -- Module      : Language.JavaScript.ParserMonad
    -- Copyright   : (c) 2012 Alan Zimmerman
    -- License     : BSD-style
    -- Stability   : experimental
    -- Portability : ghc
    --
    -- Monad support for JavaScript parser and lexer.
    -----------------------------------------------------------------------------

    module Language.JavaScript.Parser.ParserMonad
        ( AlexUserState(..)
        , alexInitUserState
        ) where

    import Language.JavaScript.Parser.Token
    import Language.JavaScript.Parser.SrcLocation

    data AlexUserState = AlexUserState
        { AlexUserState -> Token
    previousToken :: !Token   -- ^the previous token
        , AlexUserState -> [Token]
    comment :: [Token]        -- ^the previous comment, if any
        , AlexUserState -> Bool
    inTemplate :: Bool        -- ^whether the parser is expecting template characters
        }

    alexInitUserState :: AlexUserState
    alexInitUserState :: AlexUserState
    alexInitUserState = AlexUserState
        { previousToken :: Token
    previousToken = Token
    initToken
        , comment :: [Token]
    comment = []
        , inTemplate :: Bool
    inTemplate = Bool
    False
        }

    initToken :: Token
    initToken :: Token
    initToken = TokenPosn -> String -> [CommentAnnotation] -> Token
    CommentToken TokenPosn
    tokenPosnEmpty String
    "" []