    {-# LANGUAGE CPP #-}
    {-# LANGUAGE FlexibleContexts #-}

    module Text.Heterocephalus.Parse.Option where

    import Control.Monad.Reader (MonadReader, reader)

    data ParseOptions = ParseOptions
      { ParseOptions -> Char
    parseOptionsControlPrefix :: Char
      , ParseOptions -> Char
    parseOptionsVariablePrefix :: Char
      }

    -- | Default set of parser options.
    --
    -- Sets 'parseOptionsControlPrefix' to @\'%\'@  and
    -- 'parseOptionsVariablePrefix' to @\'#\'@.
    defaultParseOptions :: ParseOptions
    defaultParseOptions :: ParseOptions
    defaultParseOptions = Char -> Char -> ParseOptions
    createParseOptions '%' '#'

    createParseOptions
      :: Char  -- ^ The control prefix.
      -> Char  -- ^ The variable prefix.
      -> ParseOptions
    createParseOptions :: Char -> Char -> ParseOptions
    createParseOptions controlPrefix :: Char
    controlPrefix varPrefix :: Char
    varPrefix = ParseOptions :: Char -> Char -> ParseOptions
    ParseOptions
      { parseOptionsControlPrefix :: Char
    parseOptionsControlPrefix = Char
    controlPrefix
      , parseOptionsVariablePrefix :: Char
    parseOptionsVariablePrefix = Char
    varPrefix
      }

    getControlPrefix :: MonadReader ParseOptions m => m Char
    getControlPrefix :: m Char
    getControlPrefix = (ParseOptions -> Char) -> m Char
    forall r (m :: * -> *) a. MonadReader r m => (r -> a) -> m a
    reader ParseOptions -> Char
    parseOptionsControlPrefix

    getVariablePrefix :: MonadReader ParseOptions m => m Char
    getVariablePrefix :: m Char
    getVariablePrefix = (ParseOptions -> Char) -> m Char
    forall r (m :: * -> *) a. MonadReader r m => (r -> a) -> m a
    reader ParseOptions -> Char
    parseOptionsVariablePrefix