module UU.Parsing( module UU.Parsing.Derived
                 , module UU.Parsing.Interface
                 , parseIO
                 ) where

import UU.Parsing.Derived
import UU.Parsing.Interface

parseIO :: (Eq s, Show s, Symbol s) => Parser s a -> [s] -> IO a
parseIO :: Parser s a -> [s] -> IO a
parseIO = (Message s (Maybe s) -> String) -> Parser s a -> [s] -> IO a
forall s inp p a.
(Symbol s, InputState inp s p) =>
(Message s p -> String) -> AnaParser inp Pair s p a -> inp -> IO a
parseIOMessage Message s (Maybe s) -> String
forall sym a.
(Eq sym, Show a, Show sym) =>
Message sym (Maybe a) -> String
showMessage 
  where showMessage :: Message sym (Maybe a) -> String
showMessage (Msg expecting :: Expecting sym
expecting position :: Maybe a
position action :: Action sym
action)  
          =  let pos :: String
pos = case Maybe a
position of
                           Nothing -> "at end of file"
                           Just s  -> case Action sym
action of 
                                Insert _ -> "before " String -> String -> String
forall a. [a] -> [a] -> [a]
++ a -> String
forall a. Show a => a -> String
show a
s
                                Delete t :: sym
t -> "at " String -> String -> String
forall a. [a] -> [a] -> [a]
++ sym -> String
forall a. Show a => a -> String
show sym
t  
             in "\n?? Error      : " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pos String -> String -> String
forall a. [a] -> [a] -> [a]
++
                "\n?? Expecting  : " String -> String -> String
forall a. [a] -> [a] -> [a]
++ Expecting sym -> String
forall a. Show a => a -> String
show Expecting sym
expecting String -> String -> String
forall a. [a] -> [a] -> [a]
++
                "\n?? Repaired by: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ Action sym -> String
forall a. Show a => a -> String
show Action sym
action String -> String -> String
forall a. [a] -> [a] -> [a]
++ "\n"