diff options
author | John MacFarlane <jgm@berkeley.edu> | 2011-07-30 18:08:02 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2011-07-30 18:08:02 -0700 |
commit | 2d14c9b4363b827604bead5c3a378630087d8a9d (patch) | |
tree | e48a060b9a89aa570765c5af24c944703986054c /src/Text/Pandoc | |
parent | 264c5a4f6bf3980a5d11dc497524b450520840ac (diff) | |
download | pandoc-2d14c9b4363b827604bead5c3a378630087d8a9d.tar.gz |
Added nonspaceChar to Text.Pandoc.Parsing.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Parsing.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs index 700076a10..eaf0c0f67 100644 --- a/src/Text/Pandoc/Parsing.hs +++ b/src/Text/Pandoc/Parsing.hs @@ -33,6 +33,7 @@ module Text.Pandoc.Parsing ( (>>~), notFollowedBy', oneOfStrings, spaceChar, + nonspaceChar, skipSpaces, blankline, blanklines, @@ -122,6 +123,10 @@ oneOfStrings listOfStrings = choice $ map (try . string) listOfStrings spaceChar :: CharParser st Char spaceChar = satisfy $ \c -> c == ' ' || c == '\t' +-- | Parses a nonspace, nonnewline character. +nonspaceChar :: CharParser st Char +nonspaceChar = satisfy $ \x -> x /= '\t' && x /= '\n' && x /= ' ' && x /= '\r' + -- | Skips zero or more spaces or tabs. skipSpaces :: GenParser Char st () skipSpaces = skipMany spaceChar |