trifecta-0.50.2.1: A modern parser combinator library with convenient diagnostics

Portabilitynon-portable
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellSafe-Infered

Text.Trifecta.Diagnostic

Contents

Description

 

Synopsis

Diagnostics

Rendering

rendering :: Source s => Delta -> s -> RenderingSource

create a drawing surface

data Caret Source

 In file included from baz.c:9
 In file included from bar.c:4
 foo.c:8:36: note
 int main(int argc, char ** argv) { int; }
                                    ^

Constructors

Caret !Delta !ByteString 

Emitting diagnostics

panic, err, fatal :: (MonadParser m, MonadDiagnostic e m) => [Diagnostic e] -> e -> m aSource

warn, note :: (MonadParser m, MonadDiagnostic e m) => [Diagnostic e] -> e -> m ()Source

verbose :: (MonadParser m, MonadDiagnostic e m) => Int -> [Diagnostic e] -> e -> m ()Source

Diagnostic Levels

data DiagnosticLevel Source

The severity of an error (or message)

Constructors

Verbose !Int

a comment we should only show to the excessively curious

Note

a comment

Warning

a warning, computation continues

Error

a user specified error

Fatal

a user specified fatal error

Panic

a non-maskable death sentence thrown by the parser itself

Instances

Eq DiagnosticLevel 
Ord DiagnosticLevel 
Read DiagnosticLevel 
Show DiagnosticLevel 
Semigroup DiagnosticLevel

Compute the maximum of two diagnostic levels

Pretty DiagnosticLevel 
PrettyTerm DiagnosticLevel

pretty print as a color coded description