Copyright | (c) Mesabloo 2021 |
---|---|
License | BSD3 |
Stability | experimental |
Portability | Portable |
Safe Haskell | None |
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 [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 [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 [msg] -> ParseErrorBundle s e -> Diagnostic msg
- class HasHints e msg where
- hints :: e -> [msg]
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 [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 [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 [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
.