]> git.pld-linux.org Git - packages/BNFC.git/blob - BNFC-alex3.patch
- rel 4
[packages/BNFC.git] / BNFC-alex3.patch
1 diff -ur BNFC-2.4.2.0/formats/haskell2/CFtoAlex2.hs BNFC-2.4.2.0-alex3/formats/haskell2/CFtoAlex2.hs
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
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    ]
12 @@ -208,6 +209,14 @@
13    "             let p' = alexMove p c",
14    "              in p' `seq` Just (c, (p', c, s))",
15    "",
16 +  "alexGetByte :: AlexInput -> Maybe (Word8,AlexInput)",
17 +  "alexGetByte (p, _, s) =",
18 +  "  case "++stringUncons++" s of",
19 +  "    "++stringNilP++"  -> Nothing",
20 +  "    "++stringConsP++" ->",
21 +  "             let p' = alexMove p c",
22 +  "              in p' `seq` Just ((fromIntegral $ ord c), (p', c, s))",
23 +  "",
24    "alexInputPrevChar :: AlexInput -> Char",
25    "alexInputPrevChar (p, c, s) = c",
26    "}"
This page took 0.03873 seconds and 3 git commands to generate.