diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-08-28 21:17:08 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-08-28 21:17:08 +0000 |
commit | e407279b35e24fc5e0472cfba2c07fc2373aacfb (patch) | |
tree | fd9fde22213b2431d906c29fb28af471f0d8d729 /src/Text | |
parent | 365c349249c9550da51e03407594a27ce5d2143e (diff) | |
download | pandoc-e407279b35e24fc5e0472cfba2c07fc2373aacfb.tar.gz |
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
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Shared.hs | 2 |
1 files changed, 1 insertions, 1 deletions
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 |