Fixed bug in anyLine parser. Previously anyLine would parse an
empty string "". But it should fail on an empty string, or we get an error from its use inside "many" combinators. git-svn-id: https://pandoc.googlecode.com/svn/trunk@587 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
7742301c09
commit
726685af1b
1 changed files with 2 additions and 1 deletions
|
@ -46,7 +46,8 @@ import Data.Char ( toUpper, toLower )
|
|||
|
||||
--- | Parse any line of text
|
||||
anyLine :: GenParser Char st [Char]
|
||||
anyLine = manyTill anyChar (newline <|> (do{eof; return '\n'}))
|
||||
anyLine = try (manyTill anyChar newline) <|> many1 anyChar
|
||||
-- second alternative is for a line ending with eof
|
||||
|
||||
-- | Parses a space or tab.
|
||||
spaceChar :: CharParser st Char
|
||||
|
|
Loading…
Add table
Reference in a new issue