Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Parser a
- parse :: Parser a -> String -> PM a
- parsePosString :: Parser a -> Position -> String -> PM a
- parseFile :: Show a => Parser a -> AbsolutePath -> String -> PM (a, FileType)
- moduleParser :: Parser Module
- moduleNameParser :: Parser QName
- acceptableFileExts :: [String]
- exprParser :: Parser Expr
- exprWhereParser :: Parser ExprWhere
- holeContentParser :: Parser HoleContent
- tokensParser :: Parser [Token]
- readFilePM :: AbsolutePath -> PM Text
- data ParseError
- = ParseError {
- errSrcFile :: !SrcFile
- errPos :: !PositionWithoutFile
- errInput :: String
- errPrevToken :: String
- errMsg :: String
- | OverlappingTokensError { }
- | InvalidExtensionError {
- errPath :: !AbsolutePath
- errValidExts :: [String]
- | ReadFileError {
- errPath :: !AbsolutePath
- errIOError :: IOError
- = ParseError {
- data ParseWarning = OverlappingTokensWarning {}
- newtype PM a = PM {
- unPM :: ExceptT ParseError (StateT [ParseWarning] IO) a
- runPMIO :: MonadIO m => PM a -> m (Either ParseError a, [ParseWarning])
Types
Parse functions
Parsers
moduleParser :: Parser Module Source #
Parses a module.
moduleNameParser :: Parser QName Source #
Parses a module name.
acceptableFileExts :: [String] Source #
Extensions supported by parseFile
.
exprParser :: Parser Expr Source #
Parses an expression.
exprWhereParser :: Parser ExprWhere Source #
Parses an expression followed by a where clause.
holeContentParser :: Parser HoleContent Source #
Parses an expression or some other content of an interaction hole.
tokensParser :: Parser [Token] Source #
Gives the parsed token stream (including comments).
Reading files.
readFilePM :: AbsolutePath -> PM Text Source #
Returns the contents of the given file.
Parse errors
data ParseError Source #
Parse errors: what you get if parsing fails.
ParseError | Errors that arise at a specific position in the file |
| |
OverlappingTokensError | Parse errors that concern a range in a file. |
InvalidExtensionError | Parse errors that concern a whole file. |
| |
ReadFileError | |
|
Instances
Show ParseError Source # | |
Defined in Agda.Syntax.Parser.Monad showsPrec :: Int -> ParseError -> ShowS # show :: ParseError -> String # showList :: [ParseError] -> ShowS # | |
Pretty ParseError Source # | |
Defined in Agda.Syntax.Parser.Monad pretty :: ParseError -> Doc Source # prettyPrec :: Int -> ParseError -> Doc Source # prettyList :: [ParseError] -> Doc Source # | |
HasRange ParseError Source # | |
Defined in Agda.Syntax.Parser.Monad getRange :: ParseError -> Range Source # | |
MonadError ParseError Parser Source # | |
Defined in Agda.Syntax.Parser.Monad throwError :: ParseError -> Parser a # catchError :: Parser a -> (ParseError -> Parser a) -> Parser a # | |
MonadError ParseError PM Source # | |
Defined in Agda.Syntax.Parser throwError :: ParseError -> PM a # catchError :: PM a -> (ParseError -> PM a) -> PM a # |
data ParseWarning Source #
Warnings for parsing.
OverlappingTokensWarning | Parse errors that concern a range in a file. |
Instances
A monad for handling parse results
PM | |
|
Instances
Monad PM Source # | |
Functor PM Source # | |
Applicative PM Source # | |
MonadIO PM Source # | |
Defined in Agda.Syntax.Parser | |
MonadError ParseError PM Source # | |
Defined in Agda.Syntax.Parser throwError :: ParseError -> PM a # catchError :: PM a -> (ParseError -> PM a) -> PM a # |
runPMIO :: MonadIO m => PM a -> m (Either ParseError a, [ParseWarning]) Source #