language-tl-0.1.1: A Parser for the Type Language

Safe HaskellNone
LanguageHaskell2010

Language.TL.Lexer

Contents

Synopsis

Documentation

type Parser = Parsec Void Text Source #

Parser type

Helper functions

many :: Parser a -> Parser [a] Source #

many' but removes whitespaces and comments before parsing each segment

many' :: Parser a -> Parser [a] Source #

many that backtracks

some :: Parser a -> Parser (NonEmpty a) Source #

some that backtracks and removes whitespaces etc.

optional :: Parser a -> Parser (Maybe a) Source #

optional' but removes whitespaces etc.

lexeme :: Parser a -> Parser a Source #

Removes whitespaces and comments before parsing

sepBy1 :: Parser a -> Parser sep -> Parser (NonEmpty a) Source #

sepBy1 that backtracks and removes whitespaces etc.

Tokenizing

string_ :: Text -> Parser Text Source #

String lexeme

char_ :: Char -> Parser Char Source #

Character lexeme

between' :: Parser open -> Parser close -> Parser a -> Parser a Source #

between but removes whitespaces etc.

comment :: Parser Comment Source #

Parses a comment block

lcIdent' :: Parser Ident Source #

Parses a lower case identfier

ucIdent' :: Parser Ident Source #

Parses a upper case identifier

lcNsIdent :: Parser Ident Source #

Parses a lower case potentially qualified identifier

ucNsIdent :: Parser Ident Source #

Parses a upper case potentially qualified identifier

lcFullIdent :: Parser FullIdent Source #

Parses a lower case full identifier

emptyKw :: Parser () Source #

Consumes keyword Empty

newKw :: Parser () Source #

Consumes keyword New

finalKw :: Parser () Source #

Consumes keyword Final

nat :: Parser Int Source #

Parses a natural number