Fixed two thunk leaks in RTF reader.

This further reduces memory usage.
See #7943.
This commit is contained in:
John MacFarlane 2022-03-29 22:42:20 -07:00
parent 97a9b2e70f
commit 5fbea20e03

View file

@ -223,7 +223,7 @@ data TokContents =
tok :: PandocMonad m => RTFParser m Tok
tok = do
pos <- getPosition
Tok pos <$> ((controlThing <|> unformattedText <|> grouped) <* skipMany nl)
Tok pos <$!> ((controlThing <|> unformattedText <|> grouped) <* skipMany nl)
where
controlThing = do
char '\\' *>
@ -255,9 +255,9 @@ tok = do
let pstr = T.pack rest
case TR.decimal pstr of
Right (i,_) ->
return $! Just $ if hyph
then (-1) * i
else i
return $! Just $! if hyph
then (-1) * i
else i
_ -> return $! Nothing
hexVal = do
char '\''