~ubuntu-branches/ubuntu/utopic/haskell-uulib/utopic

« back to all changes in this revision

Viewing changes to src/UU/Parsing.hs

  • Committer: Bazaar Package Importer
  • Author(s): Arjan Oosting
  • Date: 2006-11-18 16:24:30 UTC
  • Revision ID: james.westby@ubuntu.com-20061118162430-24ddyj27kj0uk17v
Tags: upstream-0.9.2
ImportĀ upstreamĀ versionĀ 0.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
module UU.Parsing( module UU.Parsing.Derived
 
2
                 , module UU.Parsing.Interface
 
3
                 , parseIO
 
4
                 ) where
 
5
 
 
6
import UU.Parsing.Derived
 
7
import UU.Parsing.Interface
 
8
 
 
9
parseIO :: (Eq s, Show s, Symbol s) => Parser s a -> [s] -> IO a
 
10
parseIO = parseIOMessage showMessage 
 
11
  where showMessage (Msg expecting position action)  
 
12
          =  let pos = case position of
 
13
                           Nothing -> "at end of file"
 
14
                           Just s  -> case action of 
 
15
                                Insert _ -> "before " ++ show s
 
16
                                Delete t -> "at " ++ show t  
 
17
             in "\n?? Error      : " ++ pos ++
 
18
                "\n?? Expecting  : " ++ show expecting ++
 
19
                "\n?? Repaired by: " ++ show action ++ "\n"                
 
 
b'\\ No newline at end of file'