moduleLanguage.Haskell.Exts.Parser(-- * General parsingParseable(..),ParseMode(..),defaultParseMode,ParseResult(..),fromParseResult,-- * Parsing of specific AST elements-- ** ModulesparseModule,parseModuleWithMode,parseModuleWithComments,-- ** ExpressionsparseExp,parseExpWithMode,parseExpWithComments,-- ** StatementsparseStmt,parseStmtWithMode,parseStmtWithComments,-- ** PatternsparsePat,parsePatWithMode,parsePatWithComments,-- ** DeclarationsparseDecl,parseDeclWithMode,parseDeclWithComments,-- ** TypesparseType,parseTypeWithMode,parseTypeWithComments,-- ** Option pragmasgetTopPragmas)whereimportLanguage.Haskell.Exts.InternalParser(ParseMode(..),defaultParseMode,ParseResult(..),fromParseResult)importqualifiedLanguage.Haskell.Exts.InternalParserasPimportLanguage.Haskell.Exts.Annotated.SyntaximportqualifiedLanguage.Haskell.Exts.SyntaxasSimportLanguage.Haskell.Exts.Annotated.SimplifyimportLanguage.Haskell.Exts.SrcLocimportLanguage.Haskell.Exts.CommentsgetTopPragmas::String->ParseResult[S.OptionPragma]getTopPragmas=fmap(mapsOptionPragma).P.getTopPragmas-- | Class to reuse the parse function at many different types.classParseableastwhere-- | Parse a string with default mode.parse::String->ParseResultast-- | Parse a string with an explicit mode.parseWithMode::ParseMode->String->ParseResultast-- | Parse a string with an explicit mode, returning all comments along the ASTparseWithComments::ParseMode->String->ParseResult(ast,[Comment])instanceSrcInfoloc=>Parseable(Moduleloc)whereparse=fmap(fmapfromSrcInfo).P.parseModuleparseWithMode=(fmap(fmapfromSrcInfo).).P.parseModuleWithModeparseWithCommentsmds=P.parseModuleWithCommentsmds>>=\(r,cs)->return(fmapfromSrcInfor,cs)instanceSrcInfoloc=>Parseable(Exploc)whereparse=fmap(fmapfromSrcInfo).P.parseExpparseWithMode=(fmap(fmapfromSrcInfo).).P.parseExpWithModeparseWithCommentsmds=P.parseExpWithCommentsmds>>=\(r,cs)->return(fmapfromSrcInfor,cs)instanceSrcInfoloc=>Parseable(Patloc)whereparse=fmap(fmapfromSrcInfo).P.parsePatparseWithMode=(fmap(fmapfromSrcInfo).).P.parsePatWithModeparseWithCommentsmds=P.parsePatWithCommentsmds>>=\(r,cs)->return(fmapfromSrcInfor,cs)instanceSrcInfoloc=>Parseable(Declloc)whereparse=fmap(fmapfromSrcInfo).P.parseDeclparseWithMode=(fmap(fmapfromSrcInfo).).P.parseDeclWithModeparseWithCommentsmds=P.parseDeclWithCommentsmds>>=\(r,cs)->return(fmapfromSrcInfor,cs)instanceSrcInfoloc=>Parseable(Typeloc)whereparse=fmap(fmapfromSrcInfo).P.parseTypeparseWithMode=(fmap(fmapfromSrcInfo).).P.parseTypeWithModeparseWithCommentsmds=P.parseTypeWithCommentsmds>>=\(r,cs)->return(fmapfromSrcInfor,cs)instanceSrcInfoloc=>Parseable(Stmtloc)whereparse=fmap(fmapfromSrcInfo).P.parseStmtparseWithMode=(fmap(fmapfromSrcInfo).).P.parseStmtWithModeparseWithCommentsmds=P.parseStmtWithCommentsmds>>=\(r,cs)->return(fmapfromSrcInfor,cs)-- | Parse of a string, which should contain a complete Haskell module.parseModule::String->ParseResultS.ModuleparseModule=fmapsModule.P.parseModule-- | Parse of a string containing a complete Haskell module, using an explicit mode.parseModuleWithMode::ParseMode->String->ParseResultS.ModuleparseModuleWithMode=(fmapsModule.).P.parseModuleWithMode-- | Parse of a string containing a complete Haskell module, using an explicit mode, retaining comments.parseModuleWithComments::ParseMode->String->ParseResult(S.Module,[Comment])parseModuleWithComments=(fmap(\(mod,cs)->(sModulemod,cs)).).P.parseModuleWithComments-- | Parse of a string containing a Haskell expression.parseExp::String->ParseResultS.ExpparseExp=fmapsExp.P.parseExp-- | Parse of a string containing a Haskell expression, using an explicit mode.parseExpWithMode::ParseMode->String->ParseResultS.ExpparseExpWithMode=(fmapsExp.).P.parseExpWithMode-- | Parse of a string containing a complete Haskell module, using an explicit mode, retaining comments.parseExpWithComments::ParseMode->String->ParseResult(S.Exp,[Comment])parseExpWithComments=(fmap(\(e,cs)->(sExpe,cs)).).P.parseExpWithComments-- | Parse of a string containing a Haskell pattern.parsePat::String->ParseResultS.PatparsePat=fmapsPat.P.parsePat-- | Parse of a string containing a Haskell pattern, using an explicit mode.parsePatWithMode::ParseMode->String->ParseResultS.PatparsePatWithMode=(fmapsPat.).P.parsePatWithMode-- | Parse of a string containing a complete Haskell module, using an explicit mode, retaining comments.parsePatWithComments::ParseMode->String->ParseResult(S.Pat,[Comment])parsePatWithComments=(fmap(\(p,cs)->(sPatp,cs)).).P.parsePatWithComments-- | Parse of a string containing a Haskell top-level declaration.parseDecl::String->ParseResultS.DeclparseDecl=fmapsDecl.P.parseDecl-- | Parse of a string containing a Haskell top-level declaration, using an explicit mode.parseDeclWithMode::ParseMode->String->ParseResultS.DeclparseDeclWithMode=(fmapsDecl.).P.parseDeclWithMode-- | Parse of a string containing a complete Haskell module, using an explicit mode, retaining comments.parseDeclWithComments::ParseMode->String->ParseResult(S.Decl,[Comment])parseDeclWithComments=(fmap(\(decl,cs)->(sDecldecl,cs)).).P.parseDeclWithComments-- | Parse of a string containing a Haskell type.parseType::String->ParseResultS.TypeparseType=fmapsType.P.parseType-- | Parse of a string containing a Haskell type, using an explicit mode.parseTypeWithMode::ParseMode->String->ParseResultS.TypeparseTypeWithMode=(fmapsType.).P.parseTypeWithMode-- | Parse of a string containing a complete Haskell module, using an explicit mode, retaining comments.parseTypeWithComments::ParseMode->String->ParseResult(S.Type,[Comment])parseTypeWithComments=(fmap(\(t,cs)->(sTypet,cs)).).P.parseTypeWithComments-- | Parse of a string containing a Haskell type.parseStmt::String->ParseResultS.StmtparseStmt=fmapsStmt.P.parseStmt-- | Parse of a string containing a Haskell type, using an explicit mode.parseStmtWithMode::ParseMode->String->ParseResultS.StmtparseStmtWithMode=(fmapsStmt.).P.parseStmtWithMode-- | Parse of a string containing a complete Haskell module, using an explicit mode, retaining comments.parseStmtWithComments::ParseMode->String->ParseResult(S.Stmt,[Comment])parseStmtWithComments=(fmap(\(s,cs)->(sStmts,cs)).).P.parseStmtWithCommentsinstanceParseableS.Modulewhereparse=parseModuleparseWithMode=parseModuleWithModeparseWithComments=parseModuleWithCommentsinstanceParseableS.Expwhereparse=parseExpparseWithMode=parseExpWithModeparseWithComments=parseExpWithCommentsinstanceParseableS.Patwhereparse=parsePatparseWithMode=parsePatWithModeparseWithComments=parsePatWithCommentsinstanceParseableS.Declwhereparse=parseDeclparseWithMode=parseDeclWithModeparseWithComments=parseDeclWithCommentsinstanceParseableS.Typewhereparse=parseTypeparseWithMode=parseTypeWithModeparseWithComments=parseTypeWithComments