{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-missing-fields #-}
module Text.Coffee
(
coffee
, coffeeFile
, coffeeFileReload
, coffeeFileDebug
#ifdef TEST_EXPORT
, coffeeSettings
#endif
) where
import Language.Haskell.TH.Quote (QuasiQuoter (..))
import Language.Haskell.TH.Syntax
import Text.Shakespeare
import Text.Julius
coffeeSettings :: Q ShakespeareSettings
coffeeSettings :: Q ShakespeareSettings
coffeeSettings = do
ShakespeareSettings
jsettings <- Q ShakespeareSettings
javascriptSettings
ShakespeareSettings -> Q ShakespeareSettings
forall (m :: * -> *) a. Monad m => a -> m a
return (ShakespeareSettings -> Q ShakespeareSettings)
-> ShakespeareSettings -> Q ShakespeareSettings
forall a b. (a -> b) -> a -> b
$ ShakespeareSettings
jsettings { varChar :: Char
varChar = Char
'%'
, preConversion :: Maybe PreConvert
preConversion = PreConvert -> Maybe PreConvert
forall a. a -> Maybe a
Just PreConvert :: PreConversion
-> [Char] -> [Char] -> Maybe WrapInsertion -> PreConvert
PreConvert {
preConvert :: PreConversion
preConvert = [Char] -> [[Char]] -> PreConversion
ReadProcess [Char]
"coffee" [[Char]
"-spb"]
, preEscapeIgnoreBalanced :: [Char]
preEscapeIgnoreBalanced = [Char]
"'\"`"
, preEscapeIgnoreLine :: [Char]
preEscapeIgnoreLine = [Char]
"#"
, wrapInsertion :: Maybe WrapInsertion
wrapInsertion = WrapInsertion -> Maybe WrapInsertion
forall a. a -> Maybe a
Just WrapInsertion :: Maybe [Char]
-> [Char] -> [Char] -> [Char] -> [Char] -> Bool -> WrapInsertion
WrapInsertion {
wrapInsertionIndent :: Maybe [Char]
wrapInsertionIndent = [Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
" "
, wrapInsertionStartBegin :: [Char]
wrapInsertionStartBegin = [Char]
"("
, wrapInsertionSeparator :: [Char]
wrapInsertionSeparator = [Char]
", "
, wrapInsertionStartClose :: [Char]
wrapInsertionStartClose = [Char]
") =>"
, wrapInsertionEnd :: [Char]
wrapInsertionEnd = [Char]
""
, wrapInsertionAddParens :: Bool
wrapInsertionAddParens = Bool
False
}
}
}
coffee :: QuasiQuoter
coffee :: QuasiQuoter
coffee = QuasiQuoter :: ([Char] -> Q Exp)
-> ([Char] -> Q Pat)
-> ([Char] -> Q Type)
-> ([Char] -> Q [Dec])
-> QuasiQuoter
QuasiQuoter { quoteExp :: [Char] -> Q Exp
quoteExp = \[Char]
s -> do
ShakespeareSettings
rs <- Q ShakespeareSettings
coffeeSettings
QuasiQuoter -> [Char] -> Q Exp
quoteExp (ShakespeareSettings -> QuasiQuoter
shakespeare ShakespeareSettings
rs) [Char]
s
}
coffeeFile :: FilePath -> Q Exp
coffeeFile :: [Char] -> Q Exp
coffeeFile [Char]
fp = do
ShakespeareSettings
rs <- Q ShakespeareSettings
coffeeSettings
ShakespeareSettings -> [Char] -> Q Exp
shakespeareFile ShakespeareSettings
rs [Char]
fp
coffeeFileReload :: FilePath -> Q Exp
coffeeFileReload :: [Char] -> Q Exp
coffeeFileReload [Char]
fp = do
ShakespeareSettings
rs <- Q ShakespeareSettings
coffeeSettings
ShakespeareSettings -> [Char] -> Q Exp
shakespeareFileReload ShakespeareSettings
rs [Char]
fp
coffeeFileDebug :: FilePath -> Q Exp
coffeeFileDebug :: [Char] -> Q Exp
coffeeFileDebug = [Char] -> Q Exp
coffeeFileReload
{-# DEPRECATED coffeeFileDebug "Please use coffeeFileReload instead." #-}