From 95c16bfa3b6e598bf7101c9915dac2ca62fb7889 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Tue, 2 Dec 2008 22:42:00 +0000 Subject: Moved failUnlessLHS to Text.Pandoc.Shared. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1498 788f1e2b-df1e-0410-8736-df70ead52e1b --- Text/Pandoc/Shared.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Text/Pandoc/Shared.hs') diff --git a/Text/Pandoc/Shared.hs b/Text/Pandoc/Shared.hs index 0d137e9a9..799c35e0f 100644 --- a/Text/Pandoc/Shared.hs +++ b/Text/Pandoc/Shared.hs @@ -71,6 +71,7 @@ module Text.Pandoc.Shared ( withHorizDisplacement, nullBlock, failIfStrict, + failUnlessLHS, escaped, anyOrderedListMarker, orderedListMarker, @@ -489,6 +490,12 @@ failIfStrict = do state <- getState if stateStrict state then fail "strict mode" else return () +-- | Fail unless we're in literate haskell mode. +failUnlessLHS :: GenParser tok ParserState () +failUnlessLHS = do + state <- getState + if stateLiterateHaskell state then return () else fail "Literate haskell feature" + -- | Parses backslash, then applies character parser. escaped :: GenParser Char st Char -- ^ Parser for character to escape -> GenParser Char st Inline -- cgit v1.2.3