ghc-8.0.1: The GHC API

Safe HaskellNone
LanguageHaskell2010

Lexer

Synopsis

Documentation

data Token Source #

Constructors

ITas 
ITcase 
ITclass 
ITdata 
ITdefault 
ITderiving 
ITdo 
ITelse 
IThiding 
ITforeign 
ITif 
ITimport 
ITin 
ITinfix 
ITinfixl 
ITinfixr 
ITinstance 
ITlet 
ITmodule 
ITnewtype 
ITof 
ITqualified 
ITthen 
ITtype 
ITwhere 
ITforall IsUnicodeSyntax 
ITexport 
ITlabel 
ITdynamic 
ITsafe 
ITinterruptible 
ITunsafe 
ITstdcallconv 
ITccallconv 
ITcapiconv 
ITprimcallconv 
ITjavascriptcallconv 
ITmdo 
ITfamily 
ITrole 
ITgroup 
ITby 
ITusing 
ITpattern 
ITstatic 
ITinline_prag SourceText InlineSpec RuleMatchInfo 
ITspec_prag SourceText 
ITspec_inline_prag SourceText Bool 
ITsource_prag SourceText 
ITrules_prag SourceText 
ITwarning_prag SourceText 
ITdeprecated_prag SourceText 
ITline_prag 
ITscc_prag SourceText 
ITgenerated_prag SourceText 
ITcore_prag SourceText 
ITunpack_prag SourceText 
ITnounpack_prag SourceText 
ITann_prag SourceText 
ITclose_prag 
IToptions_prag String 
ITinclude_prag String 
ITlanguage_prag 
ITvect_prag SourceText 
ITvect_scalar_prag SourceText 
ITnovect_prag SourceText 
ITminimal_prag SourceText 
IToverlappable_prag SourceText 
IToverlapping_prag SourceText 
IToverlaps_prag SourceText 
ITincoherent_prag SourceText 
ITctype SourceText 
ITdotdot 
ITcolon 
ITdcolon IsUnicodeSyntax 
ITequal 
ITlam 
ITlcase 
ITvbar 
ITlarrow IsUnicodeSyntax 
ITrarrow IsUnicodeSyntax 
ITat 
ITtilde 
ITtildehsh 
ITdarrow IsUnicodeSyntax 
ITminus 
ITbang 
ITdot 
ITbiglam 
ITocurly 
ITccurly 
ITvocurly 
ITvccurly 
ITobrack 
ITopabrack 
ITcpabrack 
ITcbrack 
IToparen 
ITcparen 
IToubxparen 
ITcubxparen 
ITsemi 
ITcomma 
ITunderscore 
ITbackquote 
ITsimpleQuote 
ITvarid FastString 
ITconid FastString 
ITvarsym FastString 
ITconsym FastString 
ITqvarid (FastString, FastString) 
ITqconid (FastString, FastString) 
ITqvarsym (FastString, FastString) 
ITqconsym (FastString, FastString) 
ITdupipvarid FastString 
ITlabelvarid FastString 
ITchar SourceText Char 
ITstring SourceText FastString 
ITinteger SourceText Integer 
ITrational FractionalLit 
ITprimchar SourceText Char 
ITprimstring SourceText ByteString 
ITprimint SourceText Integer 
ITprimword SourceText Integer 
ITprimfloat FractionalLit 
ITprimdouble FractionalLit 
ITopenExpQuote HasE 
ITopenPatQuote 
ITopenDecQuote 
ITopenTypQuote 
ITcloseQuote 
ITopenTExpQuote HasE 
ITcloseTExpQuote 
ITidEscape FastString 
ITparenEscape 
ITidTyEscape FastString 
ITparenTyEscape 
ITtyQuote 
ITquasiQuote (FastString, FastString, RealSrcSpan) 
ITqQuasiQuote (FastString, FastString, FastString, RealSrcSpan) 
ITproc 
ITrec 
IToparenbar 
ITcparenbar 
ITlarrowtail IsUnicodeSyntax 
ITrarrowtail IsUnicodeSyntax 
ITLarrowtail IsUnicodeSyntax 
ITRarrowtail IsUnicodeSyntax 
ITtypeApp 
ITunknown String 
ITeof 
ITdocCommentNext String 
ITdocCommentPrev String 
ITdocCommentNamed String 
ITdocSection Int String 
ITdocOptions String 
ITdocOptionsOld String 
ITlineComment String 
ITblockComment String 

lexer :: Bool -> (Located Token -> P a) -> P a Source #

newtype P a Source #

Constructors

P 

Fields

Instances

Monad P # 

Methods

(>>=) :: P a -> (a -> P b) -> P b Source #

(>>) :: P a -> P b -> P b Source #

return :: a -> P a Source #

fail :: String -> P a Source #

Functor P # 

Methods

fmap :: (a -> b) -> P a -> P b Source #

(<$) :: a -> P b -> P a Source #

MonadFail P # 

Methods

fail :: String -> P a Source #

Applicative P # 

Methods

pure :: a -> P a Source #

(<*>) :: P (a -> b) -> P a -> P b Source #

(*>) :: P a -> P b -> P b Source #

(<*) :: P a -> P b -> P a Source #

HasDynFlags P # 

extension :: (ExtsBitmap -> Bool) -> P Bool Source #

bangPatEnabled :: ExtsBitmap -> Bool Source #

inRulePrag :: ExtsBitmap -> Bool Source #

sccProfilingOn :: ExtsBitmap -> Bool Source #

hpcEnabled :: ExtsBitmap -> Bool Source #

type AddAnn = SrcSpan -> P () Source #

Encapsulated call to addAnnotation, requiring only the SrcSpan of the AST construct the annotation belongs to; together with the AnnKeywordId, this is is the key of the annotation map

addAnnsAt :: SrcSpan -> [AddAnn] -> P () Source #

Given a location and a list of AddAnn, apply them all to the location.

mkParensApiAnn :: SrcSpan -> [AddAnn] Source #

Given a SrcSpan that surrounds a HsPar or HsParTy, generate AddAnn values for the opening and closing bordering on the start and end of the span

moveAnnotations :: SrcSpan -> SrcSpan -> P () Source #

Move the annotations and comments belonging to the old span to the new one.