2002-03-27 08:20:32 -08:00
|
|
|
(***********************************************************************)
|
|
|
|
(* OCamldoc *)
|
|
|
|
(* *)
|
|
|
|
(* Maxence Guesdon, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
|
|
|
(* Copyright 2001 Institut National de Recherche en Informatique et *)
|
|
|
|
(* en Automatique. All rights reserved. This file is distributed *)
|
|
|
|
(* under the terms of the Q Public License version 1.0. *)
|
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
|
|
|
|
|
|
|
exception Text_syntax of int * int * string (* line, char, string *)
|
|
|
|
|
|
|
|
module Texter =
|
|
|
|
struct
|
|
|
|
(* builds a text structure from a string. *)
|
|
|
|
let text_of_string s =
|
|
|
|
let lexbuf = Lexing.from_string s in
|
|
|
|
try
|
2002-07-23 07:12:03 -07:00
|
|
|
Odoc_text_lexer.init ();
|
|
|
|
Odoc_text_parser.main Odoc_text_lexer.main lexbuf
|
2002-03-27 08:20:32 -08:00
|
|
|
with
|
2002-07-23 07:12:03 -07:00
|
|
|
_ ->
|
|
|
|
raise (Text_syntax (!Odoc_text_lexer.line_number,
|
|
|
|
!Odoc_text_lexer.char_number,
|
|
|
|
s)
|
|
|
|
)
|
2002-03-27 08:20:32 -08:00
|
|
|
end
|
|
|
|
|