1 (* Copyright Grégoire Henry 2010.
2 This file is free software, distributed under the MIT license.
3 See the file COPYING for details.
6 (* Registering type derivers into type-conv. *)
10 open Pa_deriving_common.Base
11 open Pa_deriving_common.Type
12 open Pa_deriving_common.Extend
14 let derive deriver types
=
15 let loc = Ast.loc_of_ctyp types
in
16 let decls = display_errors
loc Translate.decls types
in
17 display_errors
loc deriver
(loc, decls)
19 let register name
(deriver
, sigderiver
) =
20 let name = String.uncapitalize
name in
21 Pa_type_conv.add_generator
name (derive deriver
);
22 Pa_type_conv.add_sig_generator
name (derive sigderiver
)
24 let _ = add_register_hook
register