aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-10-23 09:42:46 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-10-23 09:42:46 -0700
commit91c325c714050313429f6d553d7fa1bef15892a2 (patch)
tree66045d8fbd6ea4a9b9a3ee90c9d406eb92faab66 /src/Text/Pandoc/Readers/LaTeX/Parsing.hs
parentd50f46d26d8584a03b775394de8878e028f8d8a4 (diff)
downloadpandoc-91c325c714050313429f6d553d7fa1bef15892a2.tar.gz
T.P.Readers.LaTeX.Parsing: add `[Tok]` parameter to rawLaTeXParser.
This allows us to avoid retokenizing multiple times in e.g. rawLaTeXBlock. (Unexported module, so not an API change.)
Diffstat (limited to 'src/Text/Pandoc/Readers/LaTeX/Parsing.hs')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX/Parsing.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
index 018ee2578..af354843a 100644
--- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
+++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
@@ -200,10 +200,9 @@ withVerbatimMode parser = do
return result
rawLaTeXParser :: (PandocMonad m, HasMacros s, HasReaderOptions s)
- => Bool -> LP m a -> LP m a -> ParserT String s m (a, String)
-rawLaTeXParser retokenize parser valParser = do
- inp <- getInput
- let toks = tokenize "source" $ T.pack inp
+ => [Tok] -> Bool -> LP m a -> LP m a
+ -> ParserT String s m (a, String)
+rawLaTeXParser toks retokenize parser valParser = do
pstate <- getState
let lstate = def{ sOptions = extractReaderOptions pstate }
let lstate' = lstate { sMacros = extractMacros pstate }