]> git.pld-linux.org Git - packages/camlp5.git/blob - patch-6.02.2-2
- rel 2
[packages/camlp5.git] / patch-6.02.2-2
1 Index: main/ast2pt.ml
2 ===================================================================
3 retrieving revision 6.33
4 diff -c -r6.33 ast2pt.ml
5 *** main/ast2pt.ml      16 Mar 2011 16:52:42 -0000      6.33
6 --- main/ast2pt.ml      17 Mar 2011 16:55:32 -0000
7 ***************
8 *** 725,730 ****
9 --- 725,737 ----
10       | t -> t ]
11   ;
12   
13 + value label_of_patt =
14 +   fun
15 +   [ PaLid _ s -> uv s
16 +   | PaTyc _ (PaLid _ s) _ -> uv s
17 +   | p -> error (MLast.loc_of_patt p) "label_of_patt; case not impl" ]
18 + ;
19
20   value rec expr =
21     fun
22     [ ExAcc loc x <:expr< val >> ->
23 ***************
24 *** 856,867 ****
25         [ [(PaLab ploc lppo, w, e)] ->
26             List.fold_right
27               (fun (p, po) e -> do {
28 !                let lab =
29 !                  match p with
30 !                  [ PaLid _ lab -> uv lab
31 !                  | PaTyc _ (PaLid _ lab) _ -> uv lab
32 !                  | _ -> error loc "not impl label for that patt 1" ]
33 !                in
34                  let p =
35                    match uv po with
36                    [ Some p -> p
37 --- 863,869 ----
38         [ [(PaLab ploc lppo, w, e)] ->
39             List.fold_right
40               (fun (p, po) e -> do {
41 !                let lab = label_of_patt p in
42                  let p =
43                    match uv po with
44                    [ Some p -> p
45 ***************
46 *** 878,889 ****
47                 | None -> mkexp loc (newtype (uv s) (expr e)) ]
48             | None -> error loc "(type ..) not in this ocaml version" ]
49         | [(PaOlb loc p eo, w, e)] ->
50 !           let lab =
51 !             match p with
52 !             [ PaLid _ lab -> uv lab
53 !             | PaTyc _ (PaLid _ lab) _ -> uv lab
54 !             | _ -> error loc "not impl label for that patt 2" ]
55 !           in
56             let (p, eo) =
57               match uv eo with
58               [ Some (ExOlb _ p eo) -> (p, eo)
59 --- 880,886 ----
60                 | None -> mkexp loc (newtype (uv s) (expr e)) ]
61             | None -> error loc "(type ..) not in this ocaml version" ]
62         | [(PaOlb loc p eo, w, e)] ->
63 !           let lab = label_of_patt p in
64             let (p, eo) =
65               match uv eo with
66               [ Some (ExOlb _ p eo) -> (p, eo)
67 ***************
68 *** 1326,1336 ****
69         [ Some pcl_fun ->
70             match uv lppo with
71             [ [(p, po)] -> do {
72 !               let lab =
73 !                 match p with
74 !                 [ PaLid _ s -> uv s
75 !                 | p -> error loc "label not implemented in that case 2" ]
76 !               in
77                 let p =
78                   match uv po with
79                   [ Some p -> p
80 --- 1323,1329 ----
81         [ Some pcl_fun ->
82             match uv lppo with
83             [ [(p, po)] -> do {
84 !               let lab = label_of_patt p in
85                 let p =
86                   match uv po with
87                   [ Some p -> p
88 ***************
89 *** 1343,1353 ****
90     | CeFun loc (PaOlb _ p eo) ce ->
91         match ocaml_pcl_fun with
92         [ Some pcl_fun ->
93 !           let lab =
94 !             match p with
95 !             [ PaLid _ s -> uv s
96 !             | p -> error loc "label not implemented in that case 4" ]
97 !           in
98             let (p, eo) =
99               match uv eo with
100               [ Some (ExOlb _ p eo) -> (p, eo)
101 --- 1336,1342 ----
102     | CeFun loc (PaOlb _ p eo) ce ->
103         match ocaml_pcl_fun with
104         [ Some pcl_fun ->
105 !           let lab = label_of_patt p in
106             let (p, eo) =
107               match uv eo with
108               [ Some (ExOlb _ p eo) -> (p, eo)
109 Index: ocaml_src/main/ast2pt.ml
110 ===================================================================
111 retrieving revision 6.33
112 diff -c -r6.33 ast2pt.ml
113 *** ocaml_src/main/ast2pt.ml    16 Mar 2011 16:52:42 -0000      6.33
114 --- ocaml_src/main/ast2pt.ml    17 Mar 2011 16:56:42 -0000
115 ***************
116 *** 881,886 ****
117 --- 881,893 ----
118     loop
119   ;;
120   
121 + let label_of_patt =
122 +   function
123 +     PaLid (_, s) -> uv s
124 +   | PaTyc (_, PaLid (_, s), _) -> uv s
125 +   | p -> error (MLast.loc_of_patt p) "label_of_patt; case not impl"
126 + ;;
127
128   let rec expr =
129     function
130       ExAcc (loc, x, MLast.ExLid (_, "val")) ->
131 ***************
132 *** 1015,1026 ****
133           [PaLab (ploc, lppo), w, e] ->
134             List.fold_right
135               (fun (p, po) e ->
136 !                let lab =
137 !                  match p with
138 !                    PaLid (_, lab) -> uv lab
139 !                  | PaTyc (_, PaLid (_, lab), _) -> uv lab
140 !                  | _ -> error loc "not impl label for that patt 1"
141 !                in
142                  let p =
143                    match uv po with
144                      Some p -> p
145 --- 1022,1028 ----
146           [PaLab (ploc, lppo), w, e] ->
147             List.fold_right
148               (fun (p, po) e ->
149 !                let lab = label_of_patt p in
150                  let p =
151                    match uv po with
152                      Some p -> p
153 ***************
154 *** 1038,1049 ****
155             | None -> error loc "(type ..) not in this ocaml version"
156             end
157         | [PaOlb (loc, p, eo), w, e] ->
158 !           let lab =
159 !             match p with
160 !               PaLid (_, lab) -> uv lab
161 !             | PaTyc (_, PaLid (_, lab), _) -> uv lab
162 !             | _ -> error loc "not impl label for that patt 2"
163 !           in
164             let (p, eo) =
165               match uv eo with
166                 Some (ExOlb (_, p, eo)) -> p, eo
167 --- 1040,1046 ----
168             | None -> error loc "(type ..) not in this ocaml version"
169             end
170         | [PaOlb (loc, p, eo), w, e] ->
171 !           let lab = label_of_patt p in
172             let (p, eo) =
173               match uv eo with
174                 Some (ExOlb (_, p, eo)) -> p, eo
175 ***************
176 *** 1522,1532 ****
177           Some pcl_fun ->
178             begin match uv lppo with
179               [p, po] ->
180 !               let lab =
181 !                 match p with
182 !                   PaLid (_, s) -> uv s
183 !                 | p -> error loc "label not implemented in that case 2"
184 !               in
185                 let p =
186                   match uv po with
187                     Some p -> p
188 --- 1519,1525 ----
189           Some pcl_fun ->
190             begin match uv lppo with
191               [p, po] ->
192 !               let lab = label_of_patt p in
193                 let p =
194                   match uv po with
195                     Some p -> p
196 ***************
197 *** 1540,1550 ****
198     | CeFun (loc, PaOlb (_, p, eo), ce) ->
199         begin match ocaml_pcl_fun with
200           Some pcl_fun ->
201 !           let lab =
202 !             match p with
203 !               PaLid (_, s) -> uv s
204 !             | p -> error loc "label not implemented in that case 4"
205 !           in
206             let (p, eo) =
207               match uv eo with
208                 Some (ExOlb (_, p, eo)) -> p, eo
209 --- 1533,1539 ----
210     | CeFun (loc, PaOlb (_, p, eo), ce) ->
211         begin match ocaml_pcl_fun with
212           Some pcl_fun ->
213 !           let lab = label_of_patt p in
214             let (p, eo) =
215               match uv eo with
216                 Some (ExOlb (_, p, eo)) -> p, eo
This page took 0.069118 seconds and 4 git commands to generate.