From 91c325c714050313429f6d553d7fa1bef15892a2 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 23 Oct 2019 09:42:46 -0700 Subject: 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.) --- src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/Text/Pandoc/Readers/LaTeX/Parsing.hs') 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 } -- cgit v1.2.3