From e407279b35e24fc5e0472cfba2c07fc2373aacfb Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Tue, 28 Aug 2007 21:17:08 +0000 Subject: anyLine now requires that the line end with a newline (not eof). This is a harmless assumption, since we always add newlines to the end of a block before parsing with anyLine. Yields a 10% speed boost! git-svn-id: https://pandoc.googlecode.com/svn/trunk@944 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Shared.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index ddc325374..d79345dbe 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -218,7 +218,7 @@ a >>~ b = a >>= \x -> b >> return x -- | Parse any line of text anyLine :: GenParser Char st [Char] -anyLine = manyTill anyChar (newline <|> (eof >> return '\n')) +anyLine = manyTill anyChar newline -- | Like @manyTill@, but reads at least one item. many1Till :: GenParser tok st a -- cgit v1.2.3