Skip to content

Commit d39d43e

Browse files
committed
merge with branch bin-annot
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12516 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1 parent e3d8281 commit d39d43e

File tree

132 files changed

+5465
-3636
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+5465
-3636
lines changed

.depend

Lines changed: 97 additions & 60 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ TYPING=typing/ident.cmo typing/path.cmo \
4949
typing/primitive.cmo typing/types.cmo \
5050
typing/btype.cmo typing/oprint.cmo \
5151
typing/subst.cmo typing/predef.cmo \
52-
typing/datarepr.cmo typing/env.cmo \
53-
typing/typedtree.cmo typing/ctype.cmo \
52+
typing/datarepr.cmo typing/cmi_format.cmo typing/env.cmo \
53+
typing/typedtree.cmo typing/printtyped.cmo typing/ctype.cmo \
5454
typing/printtyp.cmo typing/includeclass.cmo \
5555
typing/mtype.cmo typing/includecore.cmo \
5656
typing/includemod.cmo typing/typetexp.cmo typing/parmatch.cmo \
57-
typing/stypes.cmo typing/typecore.cmo \
57+
typing/cmt_format.cmo typing/stypes.cmo typing/typecore.cmo \
5858
typing/typedecl.cmo typing/typeclass.cmo \
5959
typing/typemod.cmo
6060

Makefile.nt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@ TYPING=typing/ident.cmo typing/path.cmo \
4646
typing/primitive.cmo typing/types.cmo \
4747
typing/btype.cmo typing/oprint.cmo \
4848
typing/subst.cmo typing/predef.cmo \
49-
typing/datarepr.cmo typing/env.cmo \
49+
typing/datarepr.cmo typing/cmi_format.cmo typing/env.cmo \
5050
typing/typedtree.cmo typing/ctype.cmo \
5151
typing/printtyp.cmo typing/includeclass.cmo \
5252
typing/mtype.cmo typing/includecore.cmo \
5353
typing/includemod.cmo typing/parmatch.cmo \
54-
typing/typetexp.cmo typing/stypes.cmo typing/typecore.cmo \
54+
typing/typetexp.cmo \
55+
typing/cmt_format.cmo typing/stypes.cmo typing/typecore.cmo \
5556
typing/typedecl.cmo typing/typeclass.cmo \
5657
typing/typemod.cmo
5758

@@ -103,7 +104,7 @@ defaultentry:
103104

104105
# Recompile the system using the bootstrap compiler
105106
all: runtime ocamlc ocamllex ocamlyacc ocamltools library ocaml \
106-
otherlibraries ocamldoc.byte ocamlbuild.byte $(CAMLP4OUT) $(DEBUGGER)
107+
otherlibraries ocamldoc.byte ocamlbuild.byte $(CAMLP4OUT) $(DEBUGGER)
107108

108109
# The compilation of ocaml will fail if the runtime has changed.
109110
# Never mind, just do make bootstrap to reach fixpoint again.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
4.01.0+dev2_2012-04-17
1+
4.01.0+dev3_2012-05-30
22

33
# The version string is the first line of this file.
44
# It must be in the format described in stdlib/sys.mli

boot/myocamlbuild.boot

3.29 KB
Binary file not shown.

boot/ocamlc

28.5 KB
Binary file not shown.

boot/ocamldep

5.82 KB
Binary file not shown.

boot/ocamllex

286 Bytes
Binary file not shown.

build/camlp4-bootstrap-recipe.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
make clean
33
./build/distclean.sh
44
./configure -prefix `pwd`/_install
5+
(cd otherlibs/labltk/browser; make help.ml)
56
./build/fastworld.sh
67
# Go to "Bootstrap camlp4"
78

@@ -121,7 +122,7 @@
121122

122123
In Camlp4/Printers/OCaml.ml:
123124
| <:expr< let open $i$ in $e$ >> ->
124-
pp f "@[<2>let open %a@]@ @[<2>in@ %a@]"
125+
pp f "@[<2>let open %a@]@ @[<2>in@ %a@]"
125126
o#ident i o#reset_semi#expr e
126127
And at the end of #simple_expr:
127128
<:expr< let open $_$ in $_$ >>

bytecomp/matching.ml

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ let filter_matrix matcher pss =
124124
let rec filter_rec = function
125125
| (p::ps)::rem ->
126126
begin match p.pat_desc with
127-
| Tpat_alias (p,_) ->
127+
| Tpat_alias (p,_,_) ->
128128
filter_rec ((p::ps)::rem)
129129
| Tpat_var _ ->
130130
filter_rec ((omega::ps)::rem)
@@ -162,9 +162,9 @@ let make_default matcher env =
162162
let ctx_matcher p =
163163
let p = normalize_pat p in
164164
match p.pat_desc with
165-
| Tpat_construct (cstr,omegas) ->
165+
| Tpat_construct (_, _, cstr,omegas,_) ->
166166
(fun q rem -> match q.pat_desc with
167-
| Tpat_construct (cstr',args) when cstr.cstr_tag=cstr'.cstr_tag ->
167+
| Tpat_construct (_, _, cstr',args,_) when cstr.cstr_tag=cstr'.cstr_tag ->
168168
p,args @ rem
169169
| Tpat_any -> p,omegas @ rem
170170
| _ -> raise NoMatch)
@@ -197,12 +197,12 @@ let ctx_matcher p =
197197
(fun q rem -> match q.pat_desc with
198198
| Tpat_tuple args -> p,args @ rem
199199
| _ -> p, omegas @ rem)
200-
| Tpat_record l -> (* Records are normalized *)
200+
| Tpat_record (l,_) -> (* Records are normalized *)
201201
(fun q rem -> match q.pat_desc with
202-
| Tpat_record l' ->
202+
| Tpat_record (l',_) ->
203203
let l' = all_record_args l' in
204-
p, List.fold_right (fun (_,p) r -> p::r) l' rem
205-
| _ -> p,List.fold_right (fun (_,p) r -> p::r) l rem)
204+
p, List.fold_right (fun (_, _, _,p) r -> p::r) l' rem
205+
| _ -> p,List.fold_right (fun (_, _, _,p) r -> p::r) l rem)
206206
| Tpat_lazy omega ->
207207
(fun q rem -> match q.pat_desc with
208208
| Tpat_lazy arg -> p, (arg::rem)
@@ -221,7 +221,7 @@ let filter_ctx q ctx =
221221
begin match p.pat_desc with
222222
| Tpat_or (p1,p2,_) ->
223223
filter_rec ({l with right=p1::ps}::{l with right=p2::ps}::rem)
224-
| Tpat_alias (p,_) ->
224+
| Tpat_alias (p,_,_) ->
225225
filter_rec ({l with right=p::ps}::rem)
226226
| Tpat_var _ ->
227227
filter_rec ({l with right=omega::ps}::rem)
@@ -507,11 +507,11 @@ exception Var of pattern
507507
let simplify_or p =
508508
let rec simpl_rec p = match p with
509509
| {pat_desc = Tpat_any|Tpat_var _} -> raise (Var p)
510-
| {pat_desc = Tpat_alias (q,id)} ->
510+
| {pat_desc = Tpat_alias (q,id,s)} ->
511511
begin try
512-
{p with pat_desc = Tpat_alias (simpl_rec q,id)}
512+
{p with pat_desc = Tpat_alias (simpl_rec q,id,s)}
513513
with
514-
| Var q -> raise (Var {p with pat_desc = Tpat_alias (q,id)})
514+
| Var q -> raise (Var {p with pat_desc = Tpat_alias (q,id,s)})
515515
end
516516
| {pat_desc = Tpat_or (p1,p2,o)} ->
517517
let q1 = simpl_rec p1 in
@@ -521,9 +521,9 @@ let simplify_or p =
521521
with
522522
| Var q2 -> raise (Var {p with pat_desc = Tpat_or (q1, q2, o)})
523523
end
524-
| {pat_desc = Tpat_record lbls} ->
524+
| {pat_desc = Tpat_record (lbls,closed)} ->
525525
let all_lbls = all_record_args lbls in
526-
{p with pat_desc=Tpat_record all_lbls}
526+
{p with pat_desc=Tpat_record (all_lbls, closed)}
527527
| _ -> p in
528528
try
529529
simpl_rec p
@@ -537,19 +537,19 @@ let simplify_cases args cls = match args with
537537
| [] -> []
538538
| ((pat :: patl, action) as cl) :: rem ->
539539
begin match pat.pat_desc with
540-
| Tpat_var id ->
540+
| Tpat_var (id, _) ->
541541
(omega :: patl, bind Alias id arg action) ::
542542
simplify rem
543543
| Tpat_any ->
544544
cl :: simplify rem
545-
| Tpat_alias(p, id) ->
545+
| Tpat_alias(p, id,_) ->
546546
simplify ((p :: patl, bind Alias id arg action) :: rem)
547-
| Tpat_record [] ->
547+
| Tpat_record ([],_) ->
548548
(omega :: patl, action)::
549549
simplify rem
550-
| Tpat_record lbls ->
550+
| Tpat_record (lbls, closed) ->
551551
let all_lbls = all_record_args lbls in
552-
let full_pat = {pat with pat_desc=Tpat_record all_lbls} in
552+
let full_pat = {pat with pat_desc=Tpat_record (all_lbls, closed)} in
553553
(full_pat::patl,action)::
554554
simplify rem
555555
| Tpat_or _ ->
@@ -574,7 +574,7 @@ let simplify_cases args cls = match args with
574574

575575
let rec what_is_cases cases = match cases with
576576
| ({pat_desc=Tpat_any} :: _, _) :: rem -> what_is_cases rem
577-
| (({pat_desc=(Tpat_var _|Tpat_or (_,_,_)|Tpat_alias (_,_))}::_),_)::_
577+
| (({pat_desc=(Tpat_var _|Tpat_or (_,_,_)|Tpat_alias (_,_,_))}::_),_)::_
578578
-> assert false (* applies to simplified matchings only *)
579579
| (p::_,_)::_ -> p
580580
| [] -> omega
@@ -606,16 +606,16 @@ let default_compat p def =
606606

607607
(* Or-pattern expansion, variables are a complication w.r.t. the article *)
608608
let rec extract_vars r p = match p.pat_desc with
609-
| Tpat_var id -> IdentSet.add id r
610-
| Tpat_alias (p, id) ->
609+
| Tpat_var (id, _) -> IdentSet.add id r
610+
| Tpat_alias (p, id,_ ) ->
611611
extract_vars (IdentSet.add id r) p
612612
| Tpat_tuple pats ->
613613
List.fold_left extract_vars r pats
614-
| Tpat_record lpats ->
614+
| Tpat_record (lpats,_) ->
615615
List.fold_left
616-
(fun r (_,p) -> extract_vars r p)
616+
(fun r (_, _, _, p) -> extract_vars r p)
617617
r lpats
618-
| Tpat_construct (_,pats) ->
618+
| Tpat_construct (_, _, _, pats,_) ->
619619
List.fold_left extract_vars r pats
620620
| Tpat_array pats ->
621621
List.fold_left extract_vars r pats
@@ -643,9 +643,9 @@ let rec explode_or_pat arg patl mk_action rem vars aliases = function
643643
arg patl mk_action
644644
(explode_or_pat arg patl mk_action rem vars aliases p2)
645645
vars aliases p1
646-
| {pat_desc = Tpat_alias (p,id)} ->
646+
| {pat_desc = Tpat_alias (p,id, _)} ->
647647
explode_or_pat arg patl mk_action rem vars (id::aliases) p
648-
| {pat_desc = Tpat_var x} ->
648+
| {pat_desc = Tpat_var (x, _)} ->
649649
let env = mk_alpha_env arg (x::aliases) vars in
650650
(omega::patl,mk_action (List.map snd env))::rem
651651
| p ->
@@ -665,7 +665,7 @@ let group_constant = function
665665
| _ -> false
666666

667667
and group_constructor = function
668-
| {pat_desc = Tpat_construct (_, _)} -> true
668+
| {pat_desc = Tpat_construct (_, _, _, _,_)} -> true
669669
| _ -> false
670670

671671
and group_variant = function
@@ -695,7 +695,7 @@ and group_lazy = function
695695
let get_group p = match p.pat_desc with
696696
| Tpat_any -> group_var
697697
| Tpat_constant _ -> group_constant
698-
| Tpat_construct (_, _) -> group_constructor
698+
| Tpat_construct (_, _, _, _, _) -> group_constructor
699699
| Tpat_tuple _ -> group_tuple
700700
| Tpat_record _ -> group_record
701701
| Tpat_array _ -> group_array
@@ -1129,15 +1129,15 @@ let make_field_args binding_kind arg first_pos last_pos argl =
11291129
in make_args first_pos
11301130

11311131
let get_key_constr = function
1132-
| {pat_desc=Tpat_construct (cstr,_)} -> cstr.cstr_tag
1132+
| {pat_desc=Tpat_construct (_, _, cstr,_,_)} -> cstr.cstr_tag
11331133
| _ -> assert false
11341134

11351135
let get_args_constr p rem = match p with
1136-
| {pat_desc=Tpat_construct (_,args)} -> args @ rem
1136+
| {pat_desc=Tpat_construct (_, _, _, args, _)} -> args @ rem
11371137
| _ -> assert false
11381138

11391139
let pat_as_constr = function
1140-
| {pat_desc=Tpat_construct (cstr,_)} -> cstr
1140+
| {pat_desc=Tpat_construct (_, _, cstr,_,_)} -> cstr
11411141
| _ -> fatal_error "Matching.pat_as_constr"
11421142

11431143

@@ -1151,7 +1151,7 @@ let matcher_constr cstr = match cstr.cstr_arity with
11511151
with
11521152
| NoMatch -> matcher_rec p2 rem
11531153
end
1154-
| Tpat_construct (cstr1, []) when cstr.cstr_tag = cstr1.cstr_tag ->
1154+
| Tpat_construct (_, _, cstr1, [],_) when cstr.cstr_tag = cstr1.cstr_tag ->
11551155
rem
11561156
| Tpat_any -> rem
11571157
| _ -> raise NoMatch in
@@ -1172,15 +1172,15 @@ pat_desc = Tpat_or (a1, a2, None)}::
11721172
rem
11731173
| _, _ -> assert false
11741174
end
1175-
| Tpat_construct (cstr1, [arg]) when cstr.cstr_tag = cstr1.cstr_tag ->
1175+
| Tpat_construct (_, _, cstr1, [arg],_) when cstr.cstr_tag = cstr1.cstr_tag ->
11761176
arg::rem
11771177
| Tpat_any -> omega::rem
11781178
| _ -> raise NoMatch in
11791179
matcher_rec
11801180
| _ ->
11811181
fun q rem -> match q.pat_desc with
11821182
| Tpat_or (_,_,_) -> raise OrPat
1183-
| Tpat_construct (cstr1, args)
1183+
| Tpat_construct (_, _, cstr1, args,_)
11841184
when cstr.cstr_tag = cstr1.cstr_tag -> args @ rem
11851185
| Tpat_any -> Parmatch.omegas cstr.cstr_arity @ rem
11861186
| _ -> raise NoMatch
@@ -1446,13 +1446,13 @@ let divide_tuple arity p ctx pm =
14461446

14471447
let record_matching_line num_fields lbl_pat_list =
14481448
let patv = Array.create num_fields omega in
1449-
List.iter (fun (lbl, pat) -> patv.(lbl.lbl_pos) <- pat) lbl_pat_list;
1449+
List.iter (fun (_, _, lbl, pat) -> patv.(lbl.lbl_pos) <- pat) lbl_pat_list;
14501450
Array.to_list patv
14511451

14521452
let get_args_record num_fields p rem = match p with
14531453
| {pat_desc=Tpat_any} ->
14541454
record_matching_line num_fields [] @ rem
1455-
| {pat_desc=Tpat_record lbl_pat_list} ->
1455+
| {pat_desc=Tpat_record (lbl_pat_list,_)} ->
14561456
record_matching_line num_fields lbl_pat_list @ rem
14571457
| _ -> assert false
14581458

@@ -1846,7 +1846,7 @@ let rec extract_pat seen k p = match p.pat_desc with
18461846
| Tpat_or (p1,p2,_) ->
18471847
let k1,seen1 = extract_pat seen k p1 in
18481848
extract_pat seen1 k1 p2
1849-
| Tpat_alias (p,_) ->
1849+
| Tpat_alias (p,_,_) ->
18501850
extract_pat seen k p
18511851
| Tpat_var _|Tpat_any ->
18521852
raise All
@@ -2367,8 +2367,8 @@ let rec comp_match_handlers comp_fun partial ctx arg first_match next_matchs = m
23672367
let rec name_pattern default = function
23682368
(pat :: patl, action) :: rem ->
23692369
begin match pat.pat_desc with
2370-
Tpat_var id -> id
2371-
| Tpat_alias(p, id) -> id
2370+
Tpat_var (id, _) -> id
2371+
| Tpat_alias(p, id, _) -> id
23722372
| _ -> name_pattern default rem
23732373
end
23742374
| _ -> Ident.create default
@@ -2438,7 +2438,7 @@ and do_compile_matching repr partial ctx arg pmh = match pmh with
24382438
compile_no_test
24392439
(divide_tuple (List.length patl) (normalize_pat pat)) ctx_combine
24402440
repr partial ctx pm
2441-
| Tpat_record ((lbl,_)::_) ->
2441+
| Tpat_record ((_, _, lbl,_)::_,_) ->
24422442
compile_no_test
24432443
(divide_record lbl.lbl_all (normalize_pat pat))
24442444
ctx_combine repr partial ctx pm
@@ -2448,7 +2448,7 @@ and do_compile_matching repr partial ctx arg pmh = match pmh with
24482448
divide_constant
24492449
(combine_constant arg cst partial)
24502450
ctx pm
2451-
| Tpat_construct (cstr, _) ->
2451+
| Tpat_construct (_, _, cstr, _, _) ->
24522452
compile_test
24532453
(compile_match repr partial) partial
24542454
divide_constructor (combine_constructor arg pat cstr partial)
@@ -2591,7 +2591,7 @@ let rec flatten_pat_line size p k = match p.pat_desc with
25912591
| Tpat_any -> omegas size::k
25922592
| Tpat_tuple args -> args::k
25932593
| Tpat_or (p1,p2,_) -> flatten_pat_line size p1 (flatten_pat_line size p2 k)
2594-
| Tpat_alias (p,_) -> (* Note: if this 'as' pat is here, then this is a useless
2594+
| Tpat_alias (p,_,_) -> (* Note: if this 'as' pat is here, then this is a useless
25952595
binding, solves PR #3780 *)
25962596
flatten_pat_line size p k
25972597
| _ -> fatal_error "Matching.flatten_pat_line"

0 commit comments

Comments
 (0)