module Data.XML.Parser.Mid.Comment where
import Control.Monad.Compat
import Data.Text (Text)
import qualified Data.Text as Text
import Data.XML.Parser.Low
import Text.Parser.Char
import Text.Parser.Combinators
comment :: CharParsing m => Monad m => m Text
= do
m ()
forall (m :: * -> *). CharParsing m => m ()
tokenCommentOpen
[Char]
content <- m Char -> m () -> m [Char]
forall (m :: * -> *) a end. Alternative m => m a -> m end -> m [a]
manyTill m Char
forall (m :: * -> *). CharParsing m => m Char
anyChar (m () -> m [Char]) -> m () -> m [Char]
forall a b. (a -> b) -> a -> b
$ m () -> m ()
forall (m :: * -> *) a. Parsing m => m a -> m a
try m ()
forall (m :: * -> *). CharParsing m => m ()
tokenCommentClose
Text -> m Text
forall (m :: * -> *) a. Monad m => a -> m a
return (Text -> m Text) -> Text -> m Text
forall a b. (a -> b) -> a -> b
$ [Char] -> Text
Text.pack [Char]
content