summaryrefslogtreecommitdiff
path: root/ocamldoc/odoc_info.ml
diff options
context:
space:
mode:
authorMaxence Guesdon <maxence.guesdon@inria.fr>2003-11-24 21:20:51 +0000
committerMaxence Guesdon <maxence.guesdon@inria.fr>2003-11-24 21:20:51 +0000
commit05b2a15d5c4b87d1fa60587518f7860f3080cf47 (patch)
tree9695446f773f0520c64b8e0434a2287ad3ddd5c5 /ocamldoc/odoc_info.ml
parent0d5a86e5204266235d183963156bcbfdc22618df (diff)
downloadocaml-05b2a15d5c4b87d1fa60587518f7860f3080cf47.tar.gz
OK - fixes: some bugs in the text parser
( ]} meaning end of code and somehting else instead of end of precode) OK - add: in Odoc_info: text_of_string, text_string_of_text, info_of_string git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5974 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'ocamldoc/odoc_info.ml')
-rw-r--r--ocamldoc/odoc_info.ml28
1 files changed, 17 insertions, 11 deletions
diff --git a/ocamldoc/odoc_info.ml b/ocamldoc/odoc_info.ml
index ffb016a148..4e11dfe2ed 100644
--- a/ocamldoc/odoc_info.ml
+++ b/ocamldoc/odoc_info.ml
@@ -50,6 +50,8 @@ and text_element = Odoc_types.text_element =
and text = text_element list
+exception Text_syntax = Odoc_text.Text_syntax
+
type see_ref = Odoc_types.see_ref =
See_url of string
| See_file of string
@@ -176,7 +178,11 @@ let apply_if_equal f v1 v2 =
else
v2
-let info_of_comment_file f =
+let text_of_string = Odoc_text.Texter.text_of_string
+
+let text_string_of_text = Odoc_text.Texter.string_of_text
+
+let info_of_string s =
let dummy =
{
i_desc = None ;
@@ -191,19 +197,19 @@ let info_of_comment_file f =
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 = Printf.sprintf "(** %s *)" (Odoc_misc.input_file_as_string f) in
- let (_, i_opt) = Odoc_comments.Basic_info_retriever.first_special f s in
- (
- match i_opt with
- None -> dummy
- | Some i -> i
- )
+ let s = Odoc_misc.input_file_as_string f in
+ info_of_string s
with
Sys_error s ->
- prerr_endline s;
- incr errors;
- dummy
+ failwith s
module Search =
struct