Safe Haskell | None |
---|---|
Language | Haskell2010 |
Error messages from compiling.
Synopsis
- data Status
- data Source = Source {}
- emptySource :: Source
- data FailureReason
- data CompilationError = CompilationError Source FailureReason
- exitCodeFor :: CompilationError -> Int
- fancyPunctuate :: [Doc ann] -> [Doc ann]
- formatErrorItem :: TechniqueToken -> ErrorItem Char -> Doc TechniqueToken
- numberOfCarots :: FailureReason -> Int
- extractErrorBundle :: Source -> ParseErrorBundle Text Void -> CompilationError
- extractParseError :: ParseError Text Void -> (Int, [ErrorItem Char], [ErrorItem Char])
Documentation
Source | |
|
emptySource :: Source Source #
data FailureReason Source #
Instances
data CompilationError Source #
Instances
Show CompilationError Source # | |
Defined in Technique.Failure showsPrec :: Int -> CompilationError -> ShowS # show :: CompilationError -> String # showList :: [CompilationError] -> ShowS # | |
Exception CompilationError Source # | |
Defined in Technique.Failure | |
Render CompilationError Source # | |
Defined in Technique.Failure type Token CompilationError # colourize :: Token CompilationError -> AnsiColour # highlight :: CompilationError -> Doc (Token CompilationError) # | |
MonadError CompilationError Translate Source # | |
Defined in Technique.Translate throwError :: CompilationError -> Translate a # catchError :: Translate a -> (CompilationError -> Translate a) -> Translate a # | |
type Token CompilationError Source # | |
Defined in Technique.Failure |
exitCodeFor :: CompilationError -> Int Source #
fancyPunctuate :: [Doc ann] -> [Doc ann] Source #
formatErrorItem :: TechniqueToken -> ErrorItem Char -> Doc TechniqueToken Source #
ErrorItem is a bit overbearing, but we handle its four cases by saying single quotes around characters, double quotes around strings, no quotes around labels (descriptive text) and hard code the end of input and newline cases.
numberOfCarots :: FailureReason -> Int Source #
extractErrorBundle :: Source -> ParseErrorBundle Text Void -> CompilationError Source #
When we get a failure in the parsing stage **megaparsec** returns a ParseErrorBundle. Extract the first error message therein (later handle more? Yeah nah), and convert it into something we can use.