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

« back to all changes in this revision

Viewing changes to src/UU/Scanner/GenTokenParser.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.Scanner.GenTokenParser where
2
 
 
 
2
import GHC.Base
3
3
import UU.Parsing.Interface(IsParser(pCostSym, pSym, (<$>)))
4
4
import UU.Scanner.GenToken(GenToken(..))
5
5
import UU.Scanner.Position(Pos, noPos)
7
7
 
8
8
pCostReserved'          :: IsParser p (GenToken key tp val) 
9
9
                        => Int -> key -> p (GenToken key tp val)
10
 
pCostReserved' c key    =  let tok = Reserved key noPos 
 
10
pCostReserved' (I# c) key
 
11
                        =  let tok = Reserved key noPos 
11
12
                           in  pCostSym c tok tok 
12
13
 
13
14
pReserved'              :: IsParser p (GenToken key tp val) 
17
18
 
18
19
pCostValToken'          :: IsParser p (GenToken key tp val) 
19
20
                        => Int -> tp -> val -> p (GenToken key tp val)
20
 
pCostValToken' c tp val =  let tok = ValToken tp val noPos 
 
21
pCostValToken' (I# c) tp val
 
22
                        =  let tok = ValToken tp val noPos 
21
23
                           in  pCostSym c tok tok 
22
24
 
23
25
pValToken'              :: IsParser p (GenToken key tp val) 
42
44
 
43
45
pReserved               :: IsParser p (GenToken key tp val) 
44
46
                        => key -> p Pos
45
 
pReserved               =  pCostReserved 5 
 
47
pReserved               =  pCostReserved 5
46
48
 
47
49
pValToken               :: IsParser p (GenToken key tp val) 
48
50
                        => tp -> val -> p (val,Pos)