]> git.pld-linux.org Git - packages/BNFC.git/blame - BNFC-alex3.patch
- cope with alex3
[packages/BNFC.git] / BNFC-alex3.patch
CommitLineData
db940f7a
JR
1diff -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-28 20:22:20.884850258 +0200
3+++ BNFC-2.4.2.0-alex3/formats/haskell2/CFtoAlex2.hs 2011-10-28 20:18:30.612414990 +0200
4@@ -1,5 +1,5 @@
5 {-
6- BNF Converter: Alex 2.0 Generator
7+ BNF Converter: Alex 3.0 Generator
8 Copyright (C) 2004 Author: Peter Gammie
9
10 This program is free software; you can redistribute it and/or modify
11@@ -59,6 +59,7 @@
12 -- "import " ++ errMod,
13 if shareStrings then "import " ++ shareMod else "",
14 if byteStrings then "import qualified Data.ByteString.Char8 as BS" else "",
15+ "import Data.Word (Word8)",
16 "}",
17 ""
18 ]
19@@ -210,6 +211,10 @@
20 "",
21 "alexInputPrevChar :: AlexInput -> Char",
22 "alexInputPrevChar (p, c, s) = c",
23+ "alexGetByte :: AlexInput -> Maybe (Word8, AlexInput)",
24+ "alexGetByte (p,[]) = Nothing",
25+ "alexGetByte (p, (c:s)) = let p' = alexMove p c in p' `seq`",
26+ " Just ((fromIntegral $ ord c), (p', s))",
27 "}"
28 ]
29 where
This page took 0.055378 seconds and 4 git commands to generate.