git.iko.soy/typeable/pandoc
on master help sign in
Fix readWithM with Stream.
commit6b7a7adcbf2415230ac866b56841b1017c5264eb authorJohn MacFarlane <jgm@berkeley.edu> dateFri 2 Nov 2018, 20:26 (8 years ago) parent9a0333e
3 files changed+4−7
pandoc.cabal+1−2 src/Text/Pandoc/Parsing.hs+2−4 src/Text/Pandoc/Readers/Roff.hs+1−1
pandoc.cabal+1−2
@@ -394,8 +394,7 @@ library
394394 http-types >= 0.8 && < 0.13,
395395 case-insensitive >= 1.2 && < 1.3,
396396 unicode-transforms >= 0.3 && < 0.4,
397− HsYAML >= 0.1.1.1 && < 0.2,
398− monad-loops >= 0.4 && < 0.5
397+ HsYAML >= 0.1.1.1 && < 0.2
399398 if impl(ghc < 8.0)
400399 build-depends: semigroups == 0.18.*,
401400 -- basement 0.0.8 and foundation 0.0.21, transitive
src/Text/Pandoc/Parsing.hs+2−4
@@ -198,7 +198,6 @@ where
198198
199199import Prelude
200200import Control.Monad.Identity
201−import Control.Monad.Loops (unfoldM)
202201import Control.Monad.Reader
203202import Data.Char (chr, isAlphaNum, isAscii, isAsciiUpper,
204203 isPunctuation, isSpace, ord, toLower, toUpper)
@@ -222,7 +221,6 @@ import Text.Pandoc.Shared
222221import qualified Text.Pandoc.UTF8 as UTF8 (putStrLn)
223222import Text.Pandoc.XML (fromEntities)
224223import Text.Parsec hiding (token)
225−import qualified Text.Parsec (uncons)
226224import Text.Parsec.Pos (initialPos, newPos, updatePosString)
227225
228226import Control.Monad.Except
@@ -1056,10 +1054,10 @@ readWithM parser state input = do
10561054 case res of
10571055 Right x -> return $ Right x
10581056 Left e -> do
1059− inp <- map fst <$> unfoldM (Text.Parsec.uncons input)
1057+ inp <- either (const "") id
1058+ <$> runParserT (many1 anyChar) state "source" input
10601059 return $ Left $ PandocParsecError inp e
10611060
1062−
10631061-- | Parse a string with a given parser and state
10641062readWith :: Parser [Char] st a
10651063 -> st
src/Text/Pandoc/Readers/Roff.hs+1−1
@@ -53,7 +53,7 @@ import Prelude
5353import Safe (lastDef)
5454import Control.Monad (void, mzero, mplus, guard)
5555import Control.Monad.Except (throwError)
56−import Control.Monad.State.Strict (StateT(..), evalStateT, get, modify, put)
56+import Control.Monad.State (StateT(..), evalStateT, get, modify, put)
5757import Text.Pandoc.Class
5858 (getResourcePath, readFileFromDirs, PandocMonad(..), report)
5959import Data.Char (isLower, toLower, toUpper, chr,