aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-03-25 15:38:30 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-03-25 15:38:30 -0700
commit82ddec698e782fef83dcd1b1fba79cd3b698c717 (patch)
treed207f053b9dd68e60d5ab61c0e792f247b09f024 /src/Text/Pandoc
parent6992050161f1bbe8d18d7d78beb3b38a4b69a23e (diff)
downloadpandoc-82ddec698e782fef83dcd1b1fba79cd3b698c717.tar.gz
LaTeX reader: Added LPState.
Plan is to use this instead of ParserState in LP.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 8c3dac263..dd94c0ac1 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -43,6 +43,7 @@ import Text.Pandoc.Parsing hiding ((<|>), many, optional, space,
import qualified Text.Pandoc.UTF8 as UTF8
import Data.Char ( chr, ord )
import Control.Monad
+import Data.Default
import Text.Pandoc.Builder
import Data.Char (isLetter, isAlphaNum)
import Control.Applicative
@@ -71,6 +72,23 @@ parseLaTeX = do
let (Pandoc _ bs') = doc bs
return $ Pandoc meta bs'
+data LPState = LPState{
+ lpMeta :: Meta
+ , lpOptions :: ReaderOptions
+ , lpHasChapters :: Bool
+ , lpParserContext :: ParserContext
+ , lpQuoteContext :: QuoteContext
+ } deriving Show
+
+instance Default LPState where
+ def = LPState{
+ lpMeta = nullMeta
+ , lpOptions = def
+ , lpHasChapters = False
+ , lpParserContext = NullState
+ , lpQuoteContext = NoQuote
+ }
+
type LP = Parser [Char] ParserState
anyControlSeq :: LP String