module Toml.Parser.Core
(
module Text.Megaparsec
, module Text.Megaparsec.Char
, module Text.Megaparsec.Char.Lexer
, Parser
, lexeme
, sc
, text
) where
import Control.Applicative (Alternative (empty))
import Data.Text (Text)
import Data.Void (Void)
import Text.Megaparsec (Parsec, anySingle, eof, errorBundlePretty, match, parse, satisfy, try,
(<?>))
import Text.Megaparsec.Char (alphaNumChar, char, digitChar, eol, hexDigitChar, octDigitChar, binDigitChar, space, space1,
string, tab)
import Text.Megaparsec.Char.Lexer (binary, float, hexadecimal, octal, signed, skipLineComment,
symbol)
import qualified Text.Megaparsec.Char.Lexer as L (lexeme, space)
type Parser = Parsec Void Text
sc :: Parser ()
sc :: Parser ()
sc = forall e s (m :: * -> *).
MonadParsec e s m =>
m () -> m () -> m () -> m ()
L.space forall e s (m :: * -> *).
(MonadParsec e s m, Token s ~ Char) =>
m ()
space1 Parser ()
lineComment forall {a}. ParsecT Void Text Identity a
blockComment
where
lineComment :: Parser ()
lineComment = forall e s (m :: * -> *).
(MonadParsec e s m, Token s ~ Char) =>
Tokens s -> m ()
skipLineComment Tokens Text
"#"
blockComment :: ParsecT Void Text Identity a
blockComment = forall (f :: * -> *) a. Alternative f => f a
empty
lexeme :: Parser a -> Parser a
lexeme :: forall a. Parser a -> Parser a
lexeme = forall e s (m :: * -> *) a. MonadParsec e s m => m () -> m a -> m a
L.lexeme Parser ()
sc
text :: Text -> Parser Text
text :: Text -> Parser Text
text = forall e s (m :: * -> *).
MonadParsec e s m =>
m () -> Tokens s -> m (Tokens s)
symbol Parser ()
sc