| Copyright | (c) Mesabloo 2021-2022 |
|---|---|
| License | BSD3 |
| Stability | experimental |
| Portability | Portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Error.Diagnose.Compat.Megaparsec
Description
Synopsis
- diagnosticFromBundle :: forall msg s e. (IsString msg, Stream s, HasHints e msg, ShowErrorComponent e, VisualStream s, TraversableStream s) => (ParseError s e -> Bool) -> Maybe msg -> msg -> Maybe [Note msg] -> ParseErrorBundle s e -> Diagnostic msg
- errorDiagnosticFromBundle :: forall msg s e. (IsString msg, Stream s, HasHints e msg, ShowErrorComponent e, VisualStream s, TraversableStream s) => Maybe msg -> msg -> Maybe [Note msg] -> ParseErrorBundle s e -> Diagnostic msg
- warningDiagnosticFromBundle :: forall msg s e. (IsString msg, Stream s, HasHints e msg, ShowErrorComponent e, VisualStream s, TraversableStream s) => Maybe msg -> msg -> Maybe [Note msg] -> ParseErrorBundle s e -> Diagnostic msg
- class HasHints e msg where
Documentation
Arguments
| :: forall msg s e. (IsString msg, Stream s, HasHints e msg, ShowErrorComponent e, VisualStream s, TraversableStream s) | |
| => (ParseError s e -> Bool) | How to decide whether this is an error or a warning diagnostic |
| -> Maybe msg | An optional error code |
| -> msg | The error message of the diagnostic |
| -> Maybe [Note msg] | Default hints when trivial errors are reported |
| -> ParseErrorBundle s e | The bundle to create a diagnostic from |
| -> Diagnostic msg |
Transforms a megaparsec ParseErrorBundle into a well-formated Diagnostic ready to be shown.
errorDiagnosticFromBundle Source #
Arguments
| :: forall msg s e. (IsString msg, Stream s, HasHints e msg, ShowErrorComponent e, VisualStream s, TraversableStream s) | |
| => Maybe msg | An optional error code |
| -> msg | The error message of the diagnostic |
| -> Maybe [Note msg] | Default hints when trivial errors are reported |
| -> ParseErrorBundle s e | The bundle to create a diagnostic from |
| -> Diagnostic msg |
Creates an error diagnostic from a megaparsec ParseErrorBundle.
warningDiagnosticFromBundle Source #
Arguments
| :: forall msg s e. (IsString msg, Stream s, HasHints e msg, ShowErrorComponent e, VisualStream s, TraversableStream s) | |
| => Maybe msg | An optional error code |
| -> msg | The error message of the diagnostic |
| -> Maybe [Note msg] | Default hints when trivial errors are reported |
| -> ParseErrorBundle s e | The bundle to create a diagnostic from |
| -> Diagnostic msg |
Creates a warning diagnostic from a megaparsec ParseErrorBundle.