diff options
author | Hugo Heuzard <hugo.heuzard@gmail.com> | 2018-04-06 18:02:46 +0100 |
---|---|---|
committer | Hugo Heuzard <hugo.heuzard@gmail.com> | 2018-04-09 22:29:46 +0100 |
commit | 002815c4bb34701a0d45031109d25acf89ad9540 (patch) | |
tree | 0dc53b83fe92379b09154ffac6c80e40f00603a9 /parsing/depend.ml | |
parent | 1122c479821501cffe4d0717beb452fc4dbe1833 (diff) | |
download | ocaml-002815c4bb34701a0d45031109d25acf89ad9540.tar.gz |
allow to attach @@ attributes on exceptions
Diffstat (limited to 'parsing/depend.ml')
-rw-r--r-- | parsing/depend.ml | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/parsing/depend.ml b/parsing/depend.ml index 9e872fbc40..84cae99bef 100644 --- a/parsing/depend.ml +++ b/parsing/depend.ml @@ -160,6 +160,9 @@ let add_type_extension bv te = add bv te.ptyext_path; List.iter (add_extension_constructor bv) te.ptyext_constructors +let add_type_exception bv te = + add_extension_constructor bv te.ptyexn_constructor + let rec add_class_type bv cty = match cty.pcty_desc with Pcty_constr(l, tyl) -> @@ -350,8 +353,8 @@ and add_sig_item (bv, m) item = List.iter (add_type_declaration bv) dcls; (bv, m) | Psig_typext te -> add_type_extension bv te; (bv, m) - | Psig_exception pext -> - add_extension_constructor bv pext; (bv, m) + | Psig_exception te -> + add_type_exception bv te; (bv, m) | Psig_module pmd -> let m' = add_modtype_binding bv pmd.pmd_type in let add = StringMap.add pmd.pmd_name.txt m' in @@ -430,8 +433,9 @@ and add_struct_item (bv, m) item : _ StringMap.t * _ StringMap.t = | Pstr_typext te -> add_type_extension bv te; (bv, m) - | Pstr_exception pext -> - add_extension_constructor bv pext; (bv, m) + | Pstr_exception te -> + add_type_exception bv te; + (bv, m) | Pstr_module x -> let b = add_module_binding bv x.pmb_expr in let add = StringMap.add x.pmb_name.txt b in |