Gentoo Archives: gentoo-commits

From: Patrice Clement <monsieurp@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-haskell/happy/files/
Date: Wed, 03 Aug 2016 07:36:32
Message-Id: 1470208914.74b9d332a4ace7abf52b6c672492376de04cfdf5.monsieurp@gentoo
1 commit: 74b9d332a4ace7abf52b6c672492376de04cfdf5
2 Author: Michael Mair-Keimberger (asterix) <m.mairkeimberger <AT> gmail <DOT> com>
3 AuthorDate: Wed Jul 27 16:52:44 2016 +0000
4 Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 3 07:21:54 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74b9d332
7
8 dev-haskell/happy: remove unused patches
9
10 Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>
11
12 dev-haskell/happy/files/happy-1.18.6-man.patch | 12 -
13 .../happy/files/happy-1.18.9-missing-tests.patch | 260 ---------------------
14 2 files changed, 272 deletions(-)
15
16 diff --git a/dev-haskell/happy/files/happy-1.18.6-man.patch b/dev-haskell/happy/files/happy-1.18.6-man.patch
17 deleted file mode 100644
18 index cd5558c..0000000
19 --- a/dev-haskell/happy/files/happy-1.18.6-man.patch
20 +++ /dev/null
21 @@ -1,12 +0,0 @@
22 -Tue Aug 2 12:16:38 EEST 2011 Sergei Trofimovich <slyfox@×××××××××××××××××.org>
23 - * doc: make happy.1 be buildabale with doc/configure
24 -diff -rN -u old-happy/doc/configure.ac new-happy/doc/configure.ac
25 ---- old-happy/doc/configure.ac 2011-08-02 12:24:20.913926740 +0300
26 -+++ new-happy/doc/configure.ac 2011-08-02 12:24:20.923926615 +0300
27 -@@ -9,5 +9,5 @@
28 -
29 - AC_PATH_PROG(DbLatexCmd,dblatex)
30 -
31 --AC_CONFIG_FILES([config.mk])
32 -+AC_CONFIG_FILES([config.mk happy.1])
33 - AC_OUTPUT
34
35 diff --git a/dev-haskell/happy/files/happy-1.18.9-missing-tests.patch b/dev-haskell/happy/files/happy-1.18.9-missing-tests.patch
36 deleted file mode 100644
37 index eb99367..0000000
38 --- a/dev-haskell/happy/files/happy-1.18.9-missing-tests.patch
39 +++ /dev/null
40 @@ -1,260 +0,0 @@
41 ---- happy-1.18.9-orig/happy.cabal 2012-02-06 20:49:56.000000000 +1100
42 -+++ happy-1.18.9/happy.cabal 2012-02-07 20:50:33.859004968 +1100
43 -@@ -100,10 +100,13 @@
44 - templates/GLR_Base.hs
45 - templates/GenericTemplate.hs
46 - templates/GLR_Lib.hs
47 -+ tests/AttrGrammar001.y
48 -+ tests/AttrGrammar002.y
49 - tests/error001.y
50 - tests/error001.stdout
51 - tests/error001.stderr
52 - tests/monad001.y
53 -+ tests/monaderror.y
54 - tests/Makefile
55 - tests/TestMulti.ly
56 - tests/Partial.ly
57 ---- happy-1.18.9-orig/tests/Makefile 2012-02-06 20:49:55.000000000 +1100
58 -+++ happy-1.18.9/tests/Makefile 2012-02-07 20:50:33.859004968 +1100
59 -@@ -1,5 +1,5 @@
60 - HAPPY=../dist/build/happy/happy
61 --HC=ghc
62 -+HC=ghc -hide-all-packages -package base -package array -package mtl
63 -
64 - TESTS = Test.ly TestMulti.ly TestPrecedence.ly bug001.ly \
65 - monad001.y monad002.ly precedence001.ly precedence002.y \
66 ---- /dev/null 2012-02-07 10:04:42.144206507 +1100
67 -+++ happy-1.18.9/tests/AttrGrammar001.y 2012-02-07 20:50:47.013316418 +1100
68 -@@ -0,0 +1,68 @@
69 -+{
70 -+import Control.Monad (unless)
71 -+}
72 -+
73 -+%tokentype { Char }
74 -+
75 -+%token a { 'a' }
76 -+%token b { 'b' }
77 -+%token c { 'c' }
78 -+
79 -+%attributetype { Attrs a }
80 -+%attribute value { a }
81 -+%attribute len { Int }
82 -+
83 -+%name parse abcstring
84 -+
85 -+%monad { Maybe }
86 -+
87 -+%%
88 -+
89 -+abcstring
90 -+ : alist blist clist
91 -+ { $$ = $1 ++ $2 ++ $3
92 -+ ; $2.len = $1.len
93 -+ ; $3.len = $1.len
94 -+ }
95 -+
96 -+alist
97 -+ : a alist
98 -+ { $$ = $1 : $>
99 -+ ; $$.len = $>.len + 1
100 -+ }
101 -+ | { $$ = []; $$.len = 0 }
102 -+
103 -+blist
104 -+ : b blist
105 -+ { $$ = $1 : $>
106 -+ ; $>.len = $$.len - 1
107 -+ }
108 -+ | { $$ = []
109 -+ ; where failUnless ($$.len == 0) "blist wrong length"
110 -+ }
111 -+
112 -+clist
113 -+ : c clist
114 -+ { $$ = $1 : $>
115 -+ ; $>.len = $$.len - 1
116 -+ }
117 -+ | { $$ = []
118 -+ ; where failUnless ($$.len == 0) "clist wrong length"
119 -+ }
120 -+
121 -+{
122 -+happyError = error "parse error"
123 -+failUnless b msg = unless b (fail msg)
124 -+
125 -+main = case parse "" of { Just _ ->
126 -+ case parse "abc" of { Just _ ->
127 -+ case parse "aaaabbbbcccc" of { Just _ ->
128 -+ case parse "abbcc" of { Nothing ->
129 -+ case parse "aabcc" of { Nothing ->
130 -+ case parse "aabbc" of { Nothing ->
131 -+ putStrLn "Test works";
132 -+ _ -> quit } ; _ -> quit }; _ -> quit };
133 -+ _ -> quit } ; _ -> quit }; _ -> quit }
134 -+
135 -+quit = putStrLn "Test failed"
136 -+}
137 ---- /dev/null 2012-02-07 10:04:42.144206507 +1100
138 -+++ happy-1.18.9/tests/AttrGrammar002.y 2012-02-07 20:50:47.013316418 +1100
139 -@@ -0,0 +1,58 @@
140 -+
141 -+%tokentype { Char }
142 -+
143 -+%token minus { '-' }
144 -+%token plus { '+' }
145 -+%token one { '1' }
146 -+%token zero { '0' }
147 -+
148 -+%attributetype { Attrs }
149 -+%attribute value { Integer }
150 -+%attribute pos { Int }
151 -+
152 -+%name parse start
153 -+
154 -+%monad { Maybe }
155 -+
156 -+%%
157 -+
158 -+start
159 -+ : num { $$ = $1 }
160 -+
161 -+num
162 -+ : bits { $$ = $1 ; $1.pos = 0 }
163 -+ | plus bits { $$ = $2 ; $2.pos = 0 }
164 -+ | minus bits { $$ = negate $2; $2.pos = 0 }
165 -+
166 -+bits
167 -+ : bit { $$ = $1
168 -+ ; $1.pos = $$.pos
169 -+ }
170 -+
171 -+ | bits bit { $$ = $1 + $2
172 -+ ; $1.pos = $$.pos + 1
173 -+ ; $2.pos = $$.pos
174 -+ }
175 -+
176 -+bit
177 -+ : zero { $$ = 0 }
178 -+ | one { $$ = 2^($$.pos) }
179 -+
180 -+
181 -+{
182 -+happyError msg = fail $ "parse error: "++msg
183 -+
184 -+main = case parse "" of { Nothing ->
185 -+ case parse "abc" of { Nothing ->
186 -+ case parse "0" of { Just 0 ->
187 -+ case parse "1" of { Just 1 ->
188 -+ case parse "101" of { Just 5 ->
189 -+ case parse "111" of { Just 7 ->
190 -+ case parse "10001" of { Just 17 ->
191 -+ putStrLn "Test worked";
192 -+ _ -> quit }; _ -> quit }; _ -> quit };
193 -+ _ -> quit }; _ -> quit }; _ -> quit };
194 -+ _ -> quit }
195 -+
196 -+quit = putStrLn "Test Failed"
197 -+}
198 ---- /dev/null 2012-02-07 10:04:42.144206507 +1100
199 -+++ happy-1.18.9/tests/ParGF.y 2012-02-07 20:50:47.014316443 +1100
200 -@@ -0,0 +1,40 @@
201 -+{-
202 -+
203 -+With Happy 1.17 this file produces "Internal Happy error" when run:
204 -+
205 -+$ happy ParGF.y && runghc ParGF.hs
206 -+ParGF.hs: Internal Happy error
207 -+
208 -+The problem is that we always pass around the "current token". When not
209 -+using %lexer and we've run out of tokens, the current token is notHappyAtAll,
210 -+which gets passed to happyError when there's an error.
211 -+
212 -+-}
213 -+
214 -+{
215 -+}
216 -+
217 -+%name pGrammar
218 -+
219 -+%tokentype { String }
220 -+%error { parseError }
221 -+
222 -+%token
223 -+ 'a' { "a" }
224 -+
225 -+%%
226 -+
227 -+Grammar :: { () }
228 -+Grammar : 'a' 'a' { () }
229 -+
230 -+{
231 -+
232 -+parseError :: [String] -> a
233 -+-- commenting out the below line gets rid of the "Internal Happy Error"
234 -+parseError ("":_) = error "bar"
235 -+parseError _ = error "foo"
236 -+
237 -+main :: IO ()
238 -+main = print $ pGrammar ["a"]
239 -+
240 -+}
241 ---- /dev/null 2012-02-07 10:04:42.144206507 +1100
242 -+++ happy-1.18.9/tests/monaderror.y 2012-02-07 20:50:47.015316467 +1100
243 -@@ -0,0 +1,57 @@
244 -+{
245 -+module Main where
246 -+
247 -+import Data.Char
248 -+import Control.Monad.Error
249 -+import System.Exit
250 -+}
251 -+
252 -+%name parseFoo
253 -+%tokentype { Token }
254 -+%error { handleError }
255 -+
256 -+%monad { ParseM } { (>>=) } { return }
257 -+
258 -+%token
259 -+ 'S' { TokenSucc }
260 -+ 'Z' { TokenZero }
261 -+
262 -+%%
263 -+
264 -+Exp : 'Z' { 0 }
265 -+ | 'S' Exp { $2 + 1 }
266 -+
267 -+{
268 -+
269 -+type ParseM a = Either ParseError a
270 -+data ParseError
271 -+ = ParseError (Maybe Token)
272 -+ | StringError String
273 -+ deriving (Eq,Show)
274 -+instance Error ParseError where
275 -+ strMsg = StringError
276 -+
277 -+data Token
278 -+ = TokenSucc
279 -+ | TokenZero
280 -+ deriving (Eq,Show)
281 -+
282 -+handleError :: [Token] -> ParseM a
283 -+handleError [] = throwError $ ParseError Nothing
284 -+handleError ts = throwError $ ParseError $ Just $ head ts
285 -+
286 -+lexer :: String -> [Token]
287 -+lexer [] = []
288 -+lexer (c:cs)
289 -+ | isSpace c = lexer cs
290 -+ | c == 'S' = TokenSucc:(lexer cs)
291 -+ | c == 'Z' = TokenZero:(lexer cs)
292 -+ | otherwise = error "lexer error"
293 -+
294 -+main :: IO ()
295 -+main = do
296 -+ let tokens = lexer "S S"
297 -+ when (parseFoo tokens /= Left (ParseError Nothing)) $ do
298 -+ print (parseFoo tokens)
299 -+ exitWith (ExitFailure 1)
300 -+}