diff options
author | Alain Frisch <alain@frisch.fr> | 2009-10-21 12:21:02 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2009-10-21 12:21:02 +0000 |
commit | 5b9496f44233188cedc4b1eaeeb855aa1c4c2f22 (patch) | |
tree | 78af2ca5e3e116488338892fb8042cd47311b336 | |
parent | 80fc45c33aa12428c7355ee783a8b7b00d66cd14 (diff) | |
download | ocaml-fstclassmod.tar.gz |
Remove the combined unpack/local binding of modules (let module (M : T) = ...).fstclassmod
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/fstclassmod@9385 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | bytecomp/translcore.ml | 2 | ||||
-rw-r--r-- | parsing/parser.mly | 2 | ||||
-rw-r--r-- | parsing/parsetree.mli | 1 | ||||
-rw-r--r-- | parsing/printast.ml | 5 | ||||
-rw-r--r-- | tools/depend.ml | 4 | ||||
-rw-r--r-- | tools/ocamlprof.ml | 1 | ||||
-rw-r--r-- | typing/typecore.ml | 22 | ||||
-rw-r--r-- | typing/typedtree.ml | 1 | ||||
-rw-r--r-- | typing/typedtree.mli | 1 | ||||
-rw-r--r-- | typing/unused_var.ml | 1 |
10 files changed, 0 insertions, 40 deletions
diff --git a/bytecomp/translcore.ml b/bytecomp/translcore.ml index 95a5aa0402..31b1e8093b 100644 --- a/bytecomp/translcore.ml +++ b/bytecomp/translcore.ml @@ -764,8 +764,6 @@ and transl_exp0 e = Llet(Strict, id, !transl_module Tcoerce_none None modl, transl_exp body) | Texp_pack modl -> !transl_module Tcoerce_none None modl - | Texp_unpack (arg, id, body) -> - Llet(Strict, id, transl_exp arg, transl_exp body) | Texp_assert (cond) -> if !Clflags.noassert then lambda_unit diff --git a/parsing/parser.mly b/parsing/parser.mly index a0d814f2b5..b5ee2bfd69 100644 --- a/parsing/parser.mly +++ b/parsing/parser.mly @@ -919,8 +919,6 @@ expr: { unclosed "object" 1 "end" 3 } | LPAREN MODULE module_expr COLON package_type RPAREN { mkexp (Pexp_pack ($3, $5)) } - | LET MODULE LPAREN UIDENT COLON package_type RPAREN EQUAL expr IN seq_expr - { mkexp (Pexp_unpack ($9, $4, $6, $11)) } ; simple_expr: val_longident diff --git a/parsing/parsetree.mli b/parsing/parsetree.mli index 5922a2a628..3778ad75e0 100644 --- a/parsing/parsetree.mli +++ b/parsing/parsetree.mli @@ -117,7 +117,6 @@ and expression_desc = | Pexp_object of class_structure | Pexp_newtype of string * expression | Pexp_pack of module_expr * package_type - | Pexp_unpack of expression * string * package_type * expression (* Value descriptions *) diff --git a/parsing/printast.ml b/parsing/printast.ml index 2efbed9d6e..45ab3833b1 100644 --- a/parsing/printast.ml +++ b/parsing/printast.ml @@ -319,11 +319,6 @@ and expression i ppf x = line i ppf "Pexp_pack %a" fmt_longident p; list i package_with ppf l; module_expr i ppf me - | Pexp_unpack (e1, m, (p,l), e2) -> - line i ppf "Pexp_unpack %s : %a" m fmt_longident p; - list i package_with ppf l; - expression i ppf e1; - expression i ppf e2 and value_description i ppf x = line i ppf "value_description\n"; diff --git a/tools/depend.ml b/tools/depend.ml index 0edaaa3113..cb00ca98cb 100644 --- a/tools/depend.ml +++ b/tools/depend.ml @@ -160,10 +160,6 @@ let rec add_expr bv exp = add_pattern bv pat; List.iter (add_class_field bv) fieldl | Pexp_newtype (_, e) -> add_expr bv e | Pexp_pack (m, _) -> add_module bv m - | Pexp_unpack (e1, id, (lid, l), e2) -> - add bv lid; - List.iter (fun (_, ty) -> add_type bv ty) l; - add_expr bv e1; add_expr (StringSet.add id bv) e2 and add_pat_expr_list bv pel = List.iter (fun (p, e) -> add_pattern bv p; add_expr bv e) pel diff --git a/tools/ocamlprof.ml b/tools/ocamlprof.ml index e2b1c2f787..bfecc07879 100644 --- a/tools/ocamlprof.ml +++ b/tools/ocamlprof.ml @@ -288,7 +288,6 @@ and rw_exp iflag sexp = | Pexp_newtype (_, sexp) -> rewrite_exp iflag sexp | Pexp_pack (smod, _) -> rewrite_mod iflag smod - | Pexp_unpack (sexp1, _, _, sexp2) -> rewrite_exp iflag sexp1; rewrite_exp iflag sexp2 and rewrite_ifbody iflag ghost sifbody = if !instr_if && not ghost then diff --git a/typing/typecore.ml b/typing/typecore.ml index cc9a535a3d..08b124bfee 100644 --- a/typing/typecore.ml +++ b/typing/typecore.ml @@ -1652,28 +1652,6 @@ let rec type_exp env sexp = exp_type = create_package_type loc env (p, l); exp_env = env } - | Pexp_unpack (e1, name, (p, l), sbody) -> - let loc = sexp.pexp_loc in - let ty = newvar() in - Ident.set_current_time ty.level; - let l, mty = Typetexp.create_package_mty loc env (p, l) in - let mty = !Typetexp.transl_modtype env mty in - let arg = type_expect env e1 (create_package_type loc env (p, l)) in - let (id, new_env) = Env.enter_module name mty env in - Ctype.init_def(Ident.current_time()); - - let body = type_exp new_env sbody in - begin try - Ctype.unify new_env body.exp_type ty - with Unify _ -> - raise(Error(loc, Scoping_let_module(name, body.exp_type))) - end; - re { - exp_desc = Texp_unpack(arg, id, body); - exp_loc = loc; - exp_type = ty; - exp_env = env } - and type_argument env sarg ty_expected' = (* ty_expected' may be generic *) let no_labels ty = diff --git a/typing/typedtree.ml b/typing/typedtree.ml index 891ba9ed95..e2b7e285e9 100644 --- a/typing/typedtree.ml +++ b/typing/typedtree.ml @@ -80,7 +80,6 @@ and expression_desc = | Texp_lazy of expression | Texp_object of class_structure * class_signature * string list | Texp_pack of module_expr - | Texp_unpack of expression * Ident.t * expression and meth = Tmeth_name of string diff --git a/typing/typedtree.mli b/typing/typedtree.mli index b7feee4c2c..a7ea525d98 100644 --- a/typing/typedtree.mli +++ b/typing/typedtree.mli @@ -79,7 +79,6 @@ and expression_desc = | Texp_lazy of expression | Texp_object of class_structure * class_signature * string list | Texp_pack of module_expr - | Texp_unpack of expression * Ident.t * expression and meth = Tmeth_name of string diff --git a/typing/unused_var.ml b/typing/unused_var.ml index c38b4d051b..589941d992 100644 --- a/typing/unused_var.ml +++ b/typing/unused_var.ml @@ -175,7 +175,6 @@ and expression ppf tbl e = | Pexp_object cs -> class_structure ppf tbl cs; | Pexp_newtype (_, e) -> expression ppf tbl e | Pexp_pack (me, _) -> module_expr ppf tbl me - | Pexp_unpack (e1, _, _, e2) -> expression ppf tbl e1; expression ppf tbl e2 and expression_option ppf tbl eo = match eo with |