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

« back to all changes in this revision

Viewing changes to src/UU/Parsing/CharParser.hs

  • Committer: Bazaar Package Importer
  • Author(s): Marco Túlio Gontijo e Silva
  • Date: 2009-04-08 20:01:10 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090408200110-96hu9fr918e1wsr1
Tags: 0.9.10-0.1
* Non-maintainer upload.
* New upstream version.  Closes: #523214.
* Use new version of haskell-devscripts.
* debian/control:
  - Use new Standards-Version.
  - cpphs is not Indep.
* debian/patches: Remove directory.
* debian/haskell-uulib-doc.doc-base: haddock's file are stored now in
  /usr/share/libghc6-uulib-doc/html/.
* debian/haskell-uulib-doc.examples: Create file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
module UU.Parsing.CharParser where
2
 
 
 
2
import GHC.Prim
3
3
import UU.Parsing.Interface
4
4
import UU.Scanner.Position
5
5
 
9
9
instance Symbol Char where
10
10
 symBefore    = pred
11
11
 symAfter     = succ
12
 
 deleteCost _ = 5
 
12
 deleteCost _ = 5#
13
13
 
14
14
data Input = Input String !Pos
15
15
 
28
28
  splitState  (Input inp pos) =  
29
29
        case inp of
30
30
          ('\CR':      xs) -> case xs of
31
 
                                ('\LF' : _ ) -> ('\CR', Input xs pos)
32
 
                                _            -> ('\CR', Input xs (newl pos))
33
 
          ('\LF':      xs) -> ( '\LF', Input xs (newl   pos))
 
31
                                ('\LF' : _ ) -> (# '\CR', Input xs pos #)
 
32
                                _            -> (# '\CR', Input xs (newl pos) #)
 
33
          ('\LF':      xs) -> (# '\LF', Input xs (newl   pos) #)
34
34
--          ('\n' :      xs) -> ( '\n' , Input xs (newl   pos)) -- \n already captured above
35
 
          ('\t' :      xs) -> ( '\t' , Input xs (tab    pos))
36
 
          (x    :      xs) -> ( x    , Input xs (advc 1 pos))
 
35
          ('\t' :      xs) -> (# '\t' , Input xs (tab    pos) #)
 
36
          (x    :      xs) -> (# x    , Input xs (advc 1 pos) #)
37
37
 
38
38
  getPosition (Input inp pos) = pos
39
39