]>
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 |
5de2bc4d JR |
2 | --- BNFC-2.4.2.0/formats/haskell2/CFtoAlex2.hs 2011-10-29 00:19:00.596837566 +0200 |
3 | +++ BNFC-2.4.2.0-alex3/formats/haskell2/CFtoAlex2.hs 2011-10-29 00:20:26.259836814 +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 | ] | |
5de2bc4d JR |
12 | @@ -208,6 +209,14 @@ |
13 | " let p' = alexMove p c", | |
14 | " in p' `seq` Just (c, (p', c, s))", | |
db940f7a | 15 | "", |
2ca602d0 | 16 | + "alexGetByte :: AlexInput -> Maybe (Word8,AlexInput)", |
3281bc19 | 17 | + "alexGetByte (p, _, s) =", |
5de2bc4d JR |
18 | + " case "++stringUncons++" s of", |
19 | + " "++stringNilP++" -> Nothing", | |
20 | + " "++stringConsP++" ->", | |
21 | + " let p' = alexMove p c", | |
2ca602d0 | 22 | + " in p' `seq` Just ((fromIntegral $ ord c), (p', c, s))", |
5de2bc4d | 23 | + "", |
2ca602d0 JR |
24 | "alexInputPrevChar :: AlexInput -> Char", |
25 | "alexInputPrevChar (p, c, s) = c", | |
5de2bc4d | 26 | "}" |