diff options
author | Jun FURUSE / 古瀬 淳 <jun.furuse@gmail.com> | 2008-01-28 05:29:20 +0000 |
---|---|---|
committer | Jun FURUSE / 古瀬 淳 <jun.furuse@gmail.com> | 2008-01-28 05:29:20 +0000 |
commit | 3f4a98da0fbf8a87c674d6737d8c6cec7e8567e5 (patch) | |
tree | f5aa13505824d708414ece1f00219b811315c44a /ocamldoc/odoc_info.ml | |
parent | 30f3fa2c5bc27f8c59930741aa1b6dd5a34a6b40 (diff) | |
download | ocaml-gcaml3090.tar.gz |
3.09.1 updategcaml3090
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gcaml3090@8792 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'ocamldoc/odoc_info.ml')
-rw-r--r-- | ocamldoc/odoc_info.ml | 49 |
1 files changed, 12 insertions, 37 deletions
diff --git a/ocamldoc/odoc_info.ml b/ocamldoc/odoc_info.ml index 48801bb969..d7454c1aae 100644 --- a/ocamldoc/odoc_info.ml +++ b/ocamldoc/odoc_info.ml @@ -48,6 +48,7 @@ and text_element = Odoc_types.text_element = | Subscript of text | Module_list of string list | Index_list + | Custom of string * text and text = text_element list @@ -226,8 +227,8 @@ let info_string_of_info i = List.iter (fun (sref, t) -> p b "\n@see %s %s" - (escape_arobas (f_see_ref sref)) - (escape_arobas (text_string_of_text t)) + (escape_arobas (f_see_ref sref)) + (escape_arobas (text_string_of_text t)) ) i.i_sees ); @@ -241,20 +242,20 @@ let info_string_of_info i = None -> () | Some t -> p b "\n@deprecated %s" - (escape_arobas (text_string_of_text t)) + (escape_arobas (text_string_of_text t)) ); List.iter (fun (s, t) -> p b "\n@param %s %s" - (escape_arobas s) - (escape_arobas (text_string_of_text t)) + (escape_arobas s) + (escape_arobas (text_string_of_text t)) ) i.i_params; List.iter (fun (s, t) -> p b "\n@raise %s %s" - (escape_arobas s) - (escape_arobas (text_string_of_text t)) + (escape_arobas s) + (escape_arobas (text_string_of_text t)) ) i.i_raised_exceptions; ( @@ -262,45 +263,19 @@ let info_string_of_info i = None -> () | Some t -> p b "\n@return %s" - (escape_arobas (text_string_of_text t)) + (escape_arobas (text_string_of_text t)) ); List.iter (fun (s, t) -> p b "\n@%s %s" s - (escape_arobas (text_string_of_text t)) + (escape_arobas (text_string_of_text t)) ) i.i_custom; Buffer.contents b -let info_of_string s = - let dummy = - { - i_desc = None ; - i_authors = [] ; - i_version = None ; - i_sees = [] ; - i_since = None ; - i_deprecated = None ; - i_params = [] ; - i_raised_exceptions = [] ; - i_return_value = None ; - i_custom = [] ; - } - in - let s2 = Printf.sprintf "(** %s *)" s in - let (_, i_opt) = Odoc_comments.Basic_info_retriever.first_special "-" s2 in - match i_opt with - None -> dummy - | Some i -> i - -let info_of_comment_file f = - try - let s = Odoc_misc.input_file_as_string f in - info_of_string s - with - Sys_error s -> - failwith s +let info_of_string = Odoc_comments.info_of_string +let info_of_comment_file = Odoc_comments.info_of_comment_file module Search = struct |