diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2006-12-20 06:50:14 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2006-12-20 06:50:14 +0000 |
commit | dc9c6450f3b16592d0ee865feafc17b670e4ad14 (patch) | |
tree | dc29955e1ea518d6652af3d12876863b19819f6d /src/Text/ParserCombinators | |
parent | 42d29838960f9aed3a08a4d76fc7e9c3941680a8 (diff) | |
download | pandoc-dc9c6450f3b16592d0ee865feafc17b670e4ad14.tar.gz |
+ Added module data for haddock.
+ Reformatted code consistently.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@252 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/ParserCombinators')
-rw-r--r-- | src/Text/ParserCombinators/Pandoc.hs | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/Text/ParserCombinators/Pandoc.hs b/src/Text/ParserCombinators/Pandoc.hs index a78b776d3..aa3277574 100644 --- a/src/Text/ParserCombinators/Pandoc.hs +++ b/src/Text/ParserCombinators/Pandoc.hs @@ -1,4 +1,14 @@ --- | Special parser combinators for Pandoc readers. +{- | + Module : Text.ParserCombinators.Pandoc + Copyright : Copyright (C) 2006 John MacFarlane + License : GNU GPL, version 2 or above + + Maintainer : John MacFarlane <jgm at berkeley dot edu> + Stability : unstable + Portability : portable + +Special parser combinators for Pandoc readers. +-} module Text.ParserCombinators.Pandoc ( many1Till, followedBy', @@ -79,8 +89,9 @@ many1Till p end = try (do rest <- manyTill p end return (first:rest)) --- | A more general form of @notFollowedBy@. This one allows any type of parser to --- be specified, and succeeds only if that parser fails. It does not consume any input. +-- | A more general form of @notFollowedBy@. This one allows any +-- type of parser to be specified, and succeeds only if that parser fails. +-- It does not consume any input. notFollowedBy' :: Show b => GenParser a st b -> GenParser a st () notFollowedBy' parser = try (do { c <- try parser; unexpected (show c) } <|> return ()) @@ -90,10 +101,9 @@ notFollowedBy' parser = try (do { c <- try parser; unexpected (show c) } followedBy' :: (Show b) => GenParser a st b -> GenParser a st () followedBy' parser = do isNotFollowed <- option False (do{ notFollowedBy' parser; return True}) - if isNotFollowed then - fail "not followed by parser" - else - return () + if isNotFollowed + then fail "not followed by parser" + else return () -- | Parses one of a list of strings (tried in order). oneOfStrings :: [String] -> GenParser Char st String |