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 = Parser () -> Parser () -> Parser () -> Parser ()
forall e s (m :: * -> *).
MonadParsec e s m =>
m () -> m () -> m () -> m ()
L.space Parser ()
forall e s (m :: * -> *).
(MonadParsec e s m, Token s ~ Char) =>
m ()
space1 Parser ()
lineComment Parser ()
forall a. ParsecT Void Text Identity a
blockComment
where
lineComment :: Parser ()
lineComment = Tokens Text -> Parser ()
forall e s (m :: * -> *).
(MonadParsec e s m, Token s ~ Char) =>
Tokens s -> m ()
skipLineComment "#"
blockComment :: ParsecT Void Text Identity a
blockComment = ParsecT Void Text Identity a
forall (f :: * -> *) a. Alternative f => f a
empty
lexeme :: Parser a -> Parser a
lexeme :: Parser a -> Parser a
lexeme = Parser () -> Parser a -> Parser a
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 = Parser ()
-> Tokens Text -> ParsecT Void Text Identity (Tokens Text)
forall e s (m :: * -> *).
MonadParsec e s m =>
m () -> Tokens s -> m (Tokens s)
symbol Parser ()
sc