dhall-lex-0.1.0.1: Lexer for the Dhall language

Safe HaskellNone
LanguageHaskell2010

Language.Dhall.Lexer

Contents

Description

This module contains a dhall lexer.

Synopsis

User functions

Types

type Token = Ann AlexPosn TokenType Source #

A token with location information.

data AlexPosn Source #

Constructors

AlexPn !Int !Int !Int 

Instances

data TokenType Source #

This is a data type for tokens, stripped of any annotation.

Instances

Eq TokenType Source # 
Show TokenType Source # 
Generic TokenType Source # 

Associated Types

type Rep TokenType :: * -> * #

NFData TokenType Source # 

Methods

rnf :: TokenType -> () #

type Rep TokenType Source # 
type Rep TokenType = D1 * (MetaData "TokenType" "Language.Dhall.Lexer.Types" "dhall-lex-0.1.0.1-7QLF3Qw5Kn1EUV1Nmried1" False) ((:+:) * ((:+:) * ((:+:) * ((:+:) * (C1 * (MetaCons "IntLit" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Integer))) (C1 * (MetaCons "DoubleLit" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Double)))) ((:+:) * (C1 * (MetaCons "NatLit" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Natural))) (C1 * (MetaCons "BoolLit" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Bool))))) ((:+:) * ((:+:) * (C1 * (MetaCons "Embedded" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * ByteString))) (C1 * (MetaCons "StringLit" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * ByteString)))) ((:+:) * (C1 * (MetaCons "TypeId" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * ByteString))) (C1 * (MetaCons "QuotedId" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * ByteString)))))) ((:+:) * ((:+:) * ((:+:) * (C1 * (MetaCons "Identifier" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * ByteString))) (C1 * (MetaCons "Keyword" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Keyword)))) ((:+:) * (C1 * (MetaCons "Special" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * ByteString))) (C1 * (MetaCons "Operator" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Operator))))) ((:+:) * ((:+:) * (C1 * (MetaCons "BeginSplice" PrefixI False) (U1 *)) (C1 * (MetaCons "EndSplice" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "StringChunk" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * ByteString))) (C1 * (MetaCons "End" PrefixI False) (U1 *))))))

data Keyword Source #

Data type for reserved keywords.

Instances

Eq Keyword Source # 

Methods

(==) :: Keyword -> Keyword -> Bool #

(/=) :: Keyword -> Keyword -> Bool #

Show Keyword Source # 
Generic Keyword Source # 

Associated Types

type Rep Keyword :: * -> * #

Methods

from :: Keyword -> Rep Keyword x #

to :: Rep Keyword x -> Keyword #

NFData Keyword Source # 

Methods

rnf :: Keyword -> () #

type Rep Keyword Source # 
type Rep Keyword = D1 * (MetaData "Keyword" "Language.Dhall.Lexer.Types" "dhall-lex-0.1.0.1-7QLF3Qw5Kn1EUV1Nmried1" False) ((:+:) * ((:+:) * ((:+:) * (C1 * (MetaCons "KwLet" PrefixI False) (U1 *)) (C1 * (MetaCons "KwIn" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "KwConstructors" PrefixI False) (U1 *)) (C1 * (MetaCons "KwMerge" PrefixI False) (U1 *)))) ((:+:) * ((:+:) * (C1 * (MetaCons "KwForall" PrefixI False) (U1 *)) (C1 * (MetaCons "KwIf" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "KwThen" PrefixI False) (U1 *)) (C1 * (MetaCons "KwElse" PrefixI False) (U1 *)))))

data Operator Source #

The operator type holds some special builtin symbols.

Instances

Eq Operator Source # 
Show Operator Source # 
Generic Operator Source # 

Associated Types

type Rep Operator :: * -> * #

Methods

from :: Operator -> Rep Operator x #

to :: Rep Operator x -> Operator #

NFData Operator Source # 

Methods

rnf :: Operator -> () #

type Rep Operator Source # 
type Rep Operator = D1 * (MetaData "Operator" "Language.Dhall.Lexer.Types" "dhall-lex-0.1.0.1-7QLF3Qw5Kn1EUV1Nmried1" False) ((:+:) * ((:+:) * ((:+:) * (C1 * (MetaCons "CombineTok" PrefixI False) (U1 *)) (C1 * (MetaCons "PreferTok" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "ArrowTok" PrefixI False) (U1 *)) (C1 * (MetaCons "LambdaTok" PrefixI False) (U1 *)))) ((:+:) * ((:+:) * (C1 * (MetaCons "AndTok" PrefixI False) (U1 *)) (C1 * (MetaCons "OrTok" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "EqTok" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "NeqTok" PrefixI False) (U1 *)) (C1 * (MetaCons "AppendTok" PrefixI False) (U1 *))))))

data Ann a b Source #

Data type for values with annotations.

Constructors

Ann 

Fields

Instances

(Eq b, Eq a) => Eq (Ann a b) Source # 

Methods

(==) :: Ann a b -> Ann a b -> Bool #

(/=) :: Ann a b -> Ann a b -> Bool #

(Show b, Show a) => Show (Ann a b) Source # 

Methods

showsPrec :: Int -> Ann a b -> ShowS #

show :: Ann a b -> String #

showList :: [Ann a b] -> ShowS #

Generic (Ann a b) Source # 

Associated Types

type Rep (Ann a b) :: * -> * #

Methods

from :: Ann a b -> Rep (Ann a b) x #

to :: Rep (Ann a b) x -> Ann a b #

(NFData b, NFData a) => NFData (Ann a b) Source # 

Methods

rnf :: Ann a b -> () #

type Rep (Ann a b) # 
type Rep (Ann a b) = D1 * (MetaData "Ann" "Language.Dhall.Lexer.Mod" "dhall-lex-0.1.0.1-7QLF3Qw5Kn1EUV1Nmried1" False) (C1 * (MetaCons "Ann" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "loc") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * a)) (S1 * (MetaSel (Just Symbol "inner") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * b))))

Internal

step :: Alex Token Source #

Get the next token. This is provided in case you want to thread the lexer through the parser. Returns End token when out of input.

newtype Alex a Source #

Constructors

Alex 

Instances

Monad Alex Source # 

Methods

(>>=) :: Alex a -> (a -> Alex b) -> Alex b #

(>>) :: Alex a -> Alex b -> Alex b #

return :: a -> Alex a #

fail :: String -> Alex a #

Functor Alex Source # 

Methods

fmap :: (a -> b) -> Alex a -> Alex b #

(<$) :: a -> Alex b -> Alex a #

Applicative Alex Source # 

Methods

pure :: a -> Alex a #

(<*>) :: Alex (a -> b) -> Alex a -> Alex b #

liftA2 :: (a -> b -> c) -> Alex a -> Alex b -> Alex c #

(*>) :: Alex a -> Alex b -> Alex b #

(<*) :: Alex a -> Alex b -> Alex a #