Copyright | (c) comp 2020 |
---|---|
License | MIT |
Maintainer | onecomputer00@gmail.com |
Stability | stable |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Combinators and functions for debugging ParserT
.
Synopsis
- module Debug.Trace
- pdbg :: (Stream s, Show (Token s), Show (Chunk s), Show e, Show l, Show a) => String -> ParserT s e l m a -> ParserT s e l m a
- (<??>) :: (Stream s, Show (Token s), Show (Chunk s), Show e, Show l, Show a) => ParserT s e l m a -> String -> ParserT s e l m a
- parseTest :: (Show (Token s), Show (Chunk s), Show e, Show l, Show a) => Parser s e l a -> s -> IO ()
- fmtP :: (Show (Token s), Show (Chunk s), Show e, Show l, Show a) => Either (ParseError s e l) a -> String
- fmtE :: (Show (Token s), Show (Chunk s), Show e, Show l) => ParseError s e l -> String
Re-exports
module Debug.Trace
Debug combinators
pdbg :: (Stream s, Show (Token s), Show (Chunk s), Show e, Show l, Show a) => String -> ParserT s e l m a -> ParserT s e l m a Source #
Wraps a parser with trace
for debugging, showing the parser state before and after the parser.
A parser can either consume or not consume tokens, and it can succeed with a parsed value or fail with an error.
(<??>) :: (Stream s, Show (Token s), Show (Chunk s), Show e, Show l, Show a) => ParserT s e l m a -> String -> ParserT s e l m a infix 0 Source #
Infix version of flip
.pdbg
Debug printers
parseTest :: (Show (Token s), Show (Chunk s), Show e, Show l, Show a) => Parser s e l a -> s -> IO () Source #
Runs a parser and prints the output or error to the console.