summaryrefslogtreecommitdiffstats
path: root/ocamldoc/odoc_ast.ml
diff options
context:
space:
mode:
authorMaxence Guesdon <maxence.guesdon@inria.fr>2003-07-04 11:39:50 +0000
committerMaxence Guesdon <maxence.guesdon@inria.fr>2003-07-04 11:39:50 +0000
commit62e030d764506fc1c76d0e459f2e86f6eb7ef139 (patch)
treef4211cc3e3de6d635fb5462fe5433ce658a210b8 /ocamldoc/odoc_ast.ml
parente64970f29dbbce99f28e1d29028854b95ee69f53 (diff)
added field ex_code to exceptions
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5657 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'ocamldoc/odoc_ast.ml')
-rw-r--r--ocamldoc/odoc_ast.ml10
1 files changed, 10 insertions, 0 deletions
diff --git a/ocamldoc/odoc_ast.ml b/ocamldoc/odoc_ast.ml
index 4b5c0ee13..9a7beb1f9 100644
--- a/ocamldoc/odoc_ast.ml
+++ b/ocamldoc/odoc_ast.ml
@@ -1048,6 +1048,8 @@ module Analyser =
raise (Failure (Odoc_messages.exception_not_found_in_typedtree complete_name))
in
let new_env = Odoc_env.add_exception env complete_name in
+ let loc_start = loc.Location.loc_start.Lexing.pos_cnum in
+ let loc_end = loc.Location.loc_end.Lexing.pos_cnum in
let new_ex =
{
ex_name = complete_name ;
@@ -1055,6 +1057,13 @@ module Analyser =
ex_args = List.map (Odoc_env.subst_type new_env) tt_excep_decl ;
ex_alias = None ;
ex_loc = { loc_impl = Some (!file_name, loc.Location.loc_start.Lexing.pos_cnum) ; loc_inter = None } ;
+ ex_code =
+ (
+ if !Odoc_args.keep_code then
+ Some (get_string_of_file loc_start loc_end)
+ else
+ None
+ ) ;
}
in
(0, new_env, [ Element_exception new_ex ])
@@ -1077,6 +1086,7 @@ module Analyser =
ex_alias = Some { ea_name = (Odoc_env.full_exception_name env (Name.from_path tt_path)) ;
ea_ex = None ; } ;
ex_loc = { loc_impl = Some (!file_name, loc.Location.loc_start.Lexing.pos_cnum) ; loc_inter = None } ;
+ ex_code = None ;
}
in
(0, new_env, [ Element_exception new_ex ])