diff options
Diffstat (limited to 'src/Text/Pandoc/Readers')
| -rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 9 | ||||
| -rw-r--r-- | src/Text/Pandoc/Readers/Org.hs | 8 |
2 files changed, 2 insertions, 15 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 043d7e94c..92cf9a22e 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -81,17 +81,10 @@ readMarkdownWithWarnings :: ReaderOptions -- ^ Reader options -> (Pandoc, [String]) readMarkdownWithWarnings opts s = runMarkdown opts s (returnWarnings parseMarkdown) - -retState :: MarkdownParser a -> MarkdownParser (a, ParserState) -retState p = do - r <- p - s <- getState - return (r, s) - runMarkdown :: ReaderOptions -> String -> MarkdownParser a -> a runMarkdown opts inp p = fst res where - imd = readWithM (retState p) def{ stateOptions = opts } (inp ++ "\n\n") + imd = readWithM (returnState p) def{ stateOptions = opts } (inp ++ "\n\n") res = runReader imd s s :: ParserState s = snd $ runReader imd s diff --git a/src/Text/Pandoc/Readers/Org.hs b/src/Text/Pandoc/Readers/Org.hs index 5cb66bfa7..fd58956d0 100644 --- a/src/Text/Pandoc/Readers/Org.hs +++ b/src/Text/Pandoc/Readers/Org.hs @@ -67,17 +67,11 @@ readOrg opts s = runOrg opts s parseOrg runOrg :: ReaderOptions -> String -> OrgParser a -> a runOrg opts inp p = fst res where - imd = readWithM (retState p) def{ orgStateOptions = opts } (inp ++ "\n\n") + imd = readWithM (returnState p) def{ orgStateOptions = opts } (inp ++ "\n\n") res = runReader imd s s :: OrgParserState s = snd $ runReader imd s -retState :: OrgParser a -> OrgParser (a, OrgParserState) -retState p = do - r <- p - s <- getState - return (r, s) - type OrgParser a = ParserT [Char] OrgParserState (Reader OrgParserState) a parseOrg :: OrgParser Pandoc |
