aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-10-15 15:54:33 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-10-15 15:54:49 -0700
commitae51de3b3d5835e1821b902a665096e41b6db11b (patch)
tree61865f0e69e0d6a5e6d4cef505392c9825fc2c29 /src/Text/Pandoc/Readers
parent1db585689ad6de5c829851a1e7b3aa0192e4e808 (diff)
downloadpandoc-ae51de3b3d5835e1821b902a665096e41b6db11b.tar.gz
LaTeX reader: small efficiency improvement.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX/Parsing.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
index 40853c5d0..b3945c372 100644
--- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
+++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
@@ -375,8 +375,9 @@ toksToString = T.unpack . untokenize
satisfyTok :: PandocMonad m => (Tok -> Bool) -> LP m Tok
satisfyTok f = do
doMacros -- apply macros on remaining input stream
+ res <- tokenPrim (T.unpack . untoken) updatePos matcher
updateState $ \st -> st{ sExpanded = False }
- tokenPrim (T.unpack . untoken) updatePos matcher
+ return res
where matcher t | f t = Just t
| otherwise = Nothing
updatePos :: SourcePos -> Tok -> [Tok] -> SourcePos