]>
Commit | Line | Data |
---|---|---|
db940f7a | 1 | diff -ur BNFC-2.4.2.0/formats/haskell2/CFtoAlex2.hs BNFC-2.4.2.0-alex3/formats/haskell2/CFtoAlex2.hs |
3281bc19 | 2 | --- BNFC-2.4.2.0/formats/haskell2/CFtoAlex2.hs 2011-10-28 20:28:01.560188285 +0200 |
2ca602d0 | 3 | +++ BNFC-2.4.2.0-alex3/formats/haskell2/CFtoAlex2.hs 2011-10-28 20:49:10.615238951 +0200 |
db940f7a JR |
4 | @@ -59,6 +59,7 @@ |
5 | -- "import " ++ errMod, | |
6 | if shareStrings then "import " ++ shareMod else "", | |
7 | if byteStrings then "import qualified Data.ByteString.Char8 as BS" else "", | |
8 | + "import Data.Word (Word8)", | |
9 | "}", | |
10 | "" | |
11 | ] | |
2ca602d0 | 12 | @@ -200,13 +201,13 @@ |
3281bc19 JR |
13 | " AlexSkip inp' len -> go inp'", |
14 | " AlexToken inp' len act -> act pos ("++stringTake++" len str) : (go inp')", | |
db940f7a | 15 | "", |
3281bc19 JR |
16 | - "alexGetChar :: AlexInput -> Maybe (Char,AlexInput)", |
17 | - "alexGetChar (p, _, s) =", | |
2ca602d0 | 18 | + "alexGetByte :: AlexInput -> Maybe (Word8,AlexInput)", |
3281bc19 JR |
19 | + "alexGetByte (p, _, s) =", |
20 | " case "++stringUncons++" s of", | |
21 | " "++stringNilP++" -> Nothing", | |
22 | " "++stringConsP++" ->", | |
2ca602d0 JR |
23 | " let p' = alexMove p c", |
24 | - " in p' `seq` Just (c, (p', c, s))", | |
25 | + " in p' `seq` Just ((fromIntegral $ ord c), (p', c, s))", | |
26 | "", | |
27 | "alexInputPrevChar :: AlexInput -> Char", | |
28 | "alexInputPrevChar (p, c, s) = c", |