Gentoo Archives: gentoo-commits

From: "Sergei Trofimovich (slyfox)" <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-haskell/happy/files: happy-1.18.6-man.patch happy-1.18.6-missing-tests.patch
Date: Tue, 02 Aug 2011 10:15:20
Message-Id: 20110802101509.F251120051@flycatcher.gentoo.org
1 slyfox 11/08/02 10:15:09
2
3 Added: happy-1.18.6-man.patch
4 happy-1.18.6-missing-tests.patch
5 Log:
6 Version bump.
7
8 (Portage version: 2.1.10.7/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.1 dev-haskell/happy/files/happy-1.18.6-man.patch
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-haskell/happy/files/happy-1.18.6-man.patch?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-haskell/happy/files/happy-1.18.6-man.patch?rev=1.1&content-type=text/plain
15
16 Index: happy-1.18.6-man.patch
17 ===================================================================
18 Tue Aug 2 12:16:38 EEST 2011 Sergei Trofimovich <slyfox@×××××××××××××××××.org>
19 * doc: make happy.1 be buildabale with doc/configure
20 diff -rN -u old-happy/doc/configure.ac new-happy/doc/configure.ac
21 --- old-happy/doc/configure.ac 2011-08-02 12:24:20.913926740 +0300
22 +++ new-happy/doc/configure.ac 2011-08-02 12:24:20.923926615 +0300
23 @@ -9,5 +9,5 @@
24
25 AC_PATH_PROG(DbLatexCmd,dblatex)
26
27 -AC_CONFIG_FILES([config.mk])
28 +AC_CONFIG_FILES([config.mk happy.1])
29 AC_OUTPUT
30
31
32
33 1.1 dev-haskell/happy/files/happy-1.18.6-missing-tests.patch
34
35 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-haskell/happy/files/happy-1.18.6-missing-tests.patch?rev=1.1&view=markup
36 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-haskell/happy/files/happy-1.18.6-missing-tests.patch?rev=1.1&content-type=text/plain
37
38 Index: happy-1.18.6-missing-tests.patch
39 ===================================================================
40 Tue Aug 2 12:17:31 EEST 2011 Sergei Trofimovich <slyfox@×××××××××××××××××.org>
41 * cabal: add missing tests to distribution tarball
42 diff -rN -u old-happy/happy.cabal new-happy/happy.cabal
43 --- old-happy/happy.cabal 2011-08-02 12:24:49.783565818 +0300
44 +++ new-happy/happy.cabal 2011-08-02 12:24:49.858564882 +0300
45 @@ -100,6 +100,8 @@
46 templates/GLR_Base.hs
47 templates/GenericTemplate.hs
48 templates/GLR_Lib.hs
49 + tests/AttrGrammar001.y
50 + tests/AttrGrammar002.y
51 tests/error001.y
52 tests/error001.stdout
53 tests/error001.stderr
54 Tue Aug 2 12:27:33 EEST 2011 Sergei Trofimovich <slyfox@×××××××××××××××××.org>
55 * tests: fix linkage against haskell98 and array packages
56 diff -rN -u old-happy/tests/Makefile new-happy/tests/Makefile
57 --- old-happy/tests/Makefile 2011-08-02 12:28:42.855652016 +0300
58 +++ new-happy/tests/Makefile 2011-08-02 12:28:43.009650091 +0300
59 @@ -1,5 +1,5 @@
60 HAPPY=../dist/build/happy/happy
61 -HC=ghc
62 +HC=ghc -package haskell98 -package array
63
64 TESTS = Test.ly TestMulti.ly TestPrecedence.ly bug001.ly \
65 monad001.y monad002.ly precedence001.ly precedence002.y \
66 diff --git a/tests/AttrGrammar001.y b/tests/AttrGrammar001.y
67 new file mode 100644
68 index 0000000..4454dd6
69 --- /dev/null
70 +++ b/tests/AttrGrammar001.y
71 @@ -0,0 +1,68 @@
72 +{
73 +import Control.Monad (unless)
74 +}
75 +
76 +%tokentype { Char }
77 +
78 +%token a { 'a' }
79 +%token b { 'b' }
80 +%token c { 'c' }
81 +
82 +%attributetype { Attrs a }
83 +%attribute value { a }
84 +%attribute len { Int }
85 +
86 +%name parse abcstring
87 +
88 +%monad { Maybe }
89 +
90 +%%
91 +
92 +abcstring
93 + : alist blist clist
94 + { $$ = $1 ++ $2 ++ $3
95 + ; $2.len = $1.len
96 + ; $3.len = $1.len
97 + }
98 +
99 +alist
100 + : a alist
101 + { $$ = $1 : $>
102 + ; $$.len = $>.len + 1
103 + }
104 + | { $$ = []; $$.len = 0 }
105 +
106 +blist
107 + : b blist
108 + { $$ = $1 : $>
109 + ; $>.len = $$.len - 1
110 + }
111 + | { $$ = []
112 + ; where failUnless ($$.len == 0) "blist wrong length"
113 + }
114 +
115 +clist
116 + : c clist
117 + { $$ = $1 : $>
118 + ; $>.len = $$.len - 1
119 + }
120 + | { $$ = []
121 + ; where failUnless ($$.len == 0) "clist wrong length"
122 + }
123 +
124 +{
125 +happyError = error "parse error"
126 +failUnless b msg = unless b (fail msg)
127 +
128 +main = case parse "" of { Just _ ->
129 + case parse "abc" of { Just _ ->
130 + case parse "aaaabbbbcccc" of { Just _ ->
131 + case parse "abbcc" of { Nothing ->
132 + case parse "aabcc" of { Nothing ->
133 + case parse "aabbc" of { Nothing ->
134 + putStrLn "Test works";
135 + _ -> quit } ; _ -> quit }; _ -> quit };
136 + _ -> quit } ; _ -> quit }; _ -> quit }
137 +
138 +quit = putStrLn "Test failed"
139 +}
140 diff --git a/tests/AttrGrammar002.y b/tests/AttrGrammar002.y
141 new file mode 100644
142 index 0000000..6041951
143 --- /dev/null
144 +++ b/tests/AttrGrammar002.y
145 @@ -0,0 +1,58 @@
146 +
147 +%tokentype { Char }
148 +
149 +%token minus { '-' }
150 +%token plus { '+' }
151 +%token one { '1' }
152 +%token zero { '0' }
153 +
154 +%attributetype { Attrs }
155 +%attribute value { Integer }
156 +%attribute pos { Int }
157 +
158 +%name parse start
159 +
160 +%monad { Maybe }
161 +
162 +%%
163 +
164 +start
165 + : num { $$ = $1 }
166 +
167 +num
168 + : bits { $$ = $1 ; $1.pos = 0 }
169 + | plus bits { $$ = $2 ; $2.pos = 0 }
170 + | minus bits { $$ = negate $2; $2.pos = 0 }
171 +
172 +bits
173 + : bit { $$ = $1
174 + ; $1.pos = $$.pos
175 + }
176 +
177 + | bits bit { $$ = $1 + $2
178 + ; $1.pos = $$.pos + 1
179 + ; $2.pos = $$.pos
180 + }
181 +
182 +bit
183 + : zero { $$ = 0 }
184 + | one { $$ = 2^($$.pos) }
185 +
186 +
187 +{
188 +happyError msg = fail $ "parse error: "++msg
189 +
190 +main = case parse "" of { Nothing ->
191 + case parse "abc" of { Nothing ->
192 + case parse "0" of { Just 0 ->
193 + case parse "1" of { Just 1 ->
194 + case parse "101" of { Just 5 ->
195 + case parse "111" of { Just 7 ->
196 + case parse "10001" of { Just 17 ->
197 + putStrLn "Test worked";
198 + _ -> quit }; _ -> quit }; _ -> quit };
199 + _ -> quit }; _ -> quit }; _ -> quit };
200 + _ -> quit }
201 +
202 +quit = putStrLn "Test Failed"
203 +}