diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-10-15 15:54:33 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-10-15 15:54:49 -0700 |
commit | ae51de3b3d5835e1821b902a665096e41b6db11b (patch) | |
tree | 61865f0e69e0d6a5e6d4cef505392c9825fc2c29 /src/Text | |
parent | 1db585689ad6de5c829851a1e7b3aa0192e4e808 (diff) | |
download | pandoc-ae51de3b3d5835e1821b902a665096e41b6db11b.tar.gz |
LaTeX reader: small efficiency improvement.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 3 |
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 |