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. *)
|
|
|
|
|
(* *)
|
|
|
|
|
(***********************************************************************)
|
|
|
|
|
|
2003-11-24 02:44:07 -08:00
|
|
|
|
(* $Id$ *)
|
|
|
|
|
|
2002-03-27 08:20:32 -08:00
|
|
|
|
(** The lexer for special comments. *)
|
|
|
|
|
|
|
|
|
|
open Lexing
|
|
|
|
|
open Odoc_parser
|
|
|
|
|
|
|
|
|
|
let line_number = ref 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let string_buffer = Buffer.create 32
|
|
|
|
|
|
|
|
|
|
(** Fonction de remise <20> z<>ro de la chaine de caract<63>res tampon *)
|
|
|
|
|
let reset_string_buffer () = Buffer.reset string_buffer
|
|
|
|
|
|
|
|
|
|
(** Fonction d'ajout d'un caract<63>re dans la chaine de caract<63>res tampon *)
|
|
|
|
|
let ajout_char_string = Buffer.add_char string_buffer
|
|
|
|
|
|
|
|
|
|
(** Add a string to the buffer. *)
|
|
|
|
|
let ajout_string = Buffer.add_string string_buffer
|
|
|
|
|
|
|
|
|
|
let lecture_string () = Buffer.contents string_buffer
|
|
|
|
|
|
2008-07-23 04:14:22 -07:00
|
|
|
|
(** The variable which will contain the description string.
|
2002-03-27 08:20:32 -08:00
|
|
|
|
Is initialized when we encounter the start of a special comment. *)
|
|
|
|
|
let description = ref ""
|
|
|
|
|
|
|
|
|
|
let blank = "[ \013\009\012]"
|
|
|
|
|
|
|
|
|
|
(** The nested comments level. *)
|
|
|
|
|
let comments_level = ref 0
|
|
|
|
|
|
|
|
|
|
let print_DEBUG2 s = print_string s; print_newline ()
|
|
|
|
|
|
|
|
|
|
(** This function returns the given string without the leading and trailing blanks.*)
|
|
|
|
|
let remove_blanks s =
|
|
|
|
|
print_DEBUG2 ("remove_blanks "^s);
|
|
|
|
|
let l = Str.split_delim (Str.regexp "\n") s in
|
|
|
|
|
let l2 =
|
|
|
|
|
let rec iter liste =
|
|
|
|
|
match liste with
|
2002-07-23 07:12:03 -07:00
|
|
|
|
h :: q ->
|
2008-07-23 04:14:22 -07:00
|
|
|
|
let h2 = Str.global_replace (Str.regexp ("^"^blank^"+")) "" h in
|
2002-07-23 07:12:03 -07:00
|
|
|
|
if h2 = "" then
|
|
|
|
|
(
|
|
|
|
|
print_DEBUG2 (h^" n'a que des blancs");
|
|
|
|
|
(* we remove this line and must remove leading blanks of the next one *)
|
|
|
|
|
iter q
|
|
|
|
|
)
|
|
|
|
|
else
|
|
|
|
|
(* we don't remove leading blanks in the remaining lines *)
|
|
|
|
|
h2 :: q
|
2002-03-27 08:20:32 -08:00
|
|
|
|
| _ ->
|
2002-07-23 07:12:03 -07:00
|
|
|
|
[]
|
2002-03-27 08:20:32 -08:00
|
|
|
|
in iter l
|
|
|
|
|
in
|
2008-07-23 04:14:22 -07:00
|
|
|
|
let l3 =
|
|
|
|
|
let rec iter liste =
|
2002-03-27 08:20:32 -08:00
|
|
|
|
match liste with
|
2002-07-23 07:12:03 -07:00
|
|
|
|
h :: q ->
|
2008-07-23 04:14:22 -07:00
|
|
|
|
let h2 = Str.global_replace (Str.regexp (blank^"+$")) "" h in
|
2002-07-23 07:12:03 -07:00
|
|
|
|
if h2 = "" then
|
|
|
|
|
(
|
|
|
|
|
print_DEBUG2 (h^" n'a que des blancs");
|
|
|
|
|
(* we remove this line and must remove trailing blanks of the next one *)
|
|
|
|
|
iter q
|
|
|
|
|
)
|
|
|
|
|
else
|
|
|
|
|
(* we don't remove trailing blanks in the remaining lines *)
|
|
|
|
|
h2 :: q
|
2002-03-27 08:20:32 -08:00
|
|
|
|
| _ ->
|
2002-07-23 07:12:03 -07:00
|
|
|
|
[]
|
2002-03-27 08:20:32 -08:00
|
|
|
|
in
|
|
|
|
|
List.rev (iter (List.rev l2))
|
|
|
|
|
in
|
|
|
|
|
String.concat "\n" l3
|
|
|
|
|
|
|
|
|
|
(** Remove first blank characters of each line of a string, until the first '*' *)
|
|
|
|
|
let remove_stars s =
|
|
|
|
|
let s2 = Str.global_replace (Str.regexp ("^"^blank^"*\\*")) "" s in
|
|
|
|
|
s2
|
2008-07-23 04:14:22 -07:00
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
let lowercase = ['a'-'z' '\223'-'\246' '\248'-'\255' '_']
|
|
|
|
|
let uppercase = ['A'-'Z' '\192'-'\214' '\216'-'\222']
|
2008-07-23 04:14:22 -07:00
|
|
|
|
let identchar =
|
2002-03-27 08:20:32 -08:00
|
|
|
|
['A'-'Z' 'a'-'z' '_' '\192'-'\214' '\216'-'\246' '\248'-'\255' '\'' '0'-'9']
|
|
|
|
|
|
|
|
|
|
rule main = parse
|
|
|
|
|
[' ' '\013' '\009' '\012'] +
|
2008-07-23 04:14:22 -07:00
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length (Lexing.lexeme lexbuf));
|
|
|
|
|
main lexbuf
|
2002-03-27 08:20:32 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
| [ '\010' ]
|
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
incr line_number;
|
|
|
|
|
incr Odoc_comments_global.nb_chars;
|
2008-07-23 04:14:22 -07:00
|
|
|
|
main lexbuf
|
2002-03-27 08:20:32 -08:00
|
|
|
|
}
|
|
|
|
|
| "(**)"
|
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length (Lexing.lexeme lexbuf));
|
|
|
|
|
Description ("", None)
|
2008-07-23 04:14:22 -07:00
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
| "(**"("*"+)")"
|
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length (Lexing.lexeme lexbuf));
|
|
|
|
|
main lexbuf
|
2008-07-23 04:14:22 -07:00
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
| "(***"
|
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length (Lexing.lexeme lexbuf));
|
|
|
|
|
incr comments_level;
|
|
|
|
|
main lexbuf
|
2008-07-23 04:14:22 -07:00
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
| "(**"
|
2008-07-23 04:14:22 -07:00
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length (Lexing.lexeme lexbuf));
|
|
|
|
|
incr comments_level;
|
|
|
|
|
if !comments_level = 1 then
|
|
|
|
|
(
|
|
|
|
|
reset_string_buffer ();
|
|
|
|
|
description := "";
|
2008-07-23 04:14:22 -07:00
|
|
|
|
special_comment lexbuf
|
2002-07-23 07:12:03 -07:00
|
|
|
|
)
|
|
|
|
|
else
|
|
|
|
|
main lexbuf
|
2002-03-27 08:20:32 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
| eof
|
|
|
|
|
{ EOF }
|
|
|
|
|
|
|
|
|
|
| "*)"
|
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length (Lexing.lexeme lexbuf));
|
|
|
|
|
decr comments_level ;
|
|
|
|
|
main lexbuf
|
2008-07-23 04:14:22 -07:00
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
| "(*"
|
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length (Lexing.lexeme lexbuf));
|
|
|
|
|
incr comments_level ;
|
|
|
|
|
main lexbuf
|
2008-07-23 04:14:22 -07:00
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
| _
|
2008-07-23 04:14:22 -07:00
|
|
|
|
{
|
2002-03-27 08:20:32 -08:00
|
|
|
|
incr Odoc_comments_global.nb_chars;
|
2002-07-23 07:12:03 -07:00
|
|
|
|
main lexbuf
|
2002-03-27 08:20:32 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
and special_comment = parse
|
|
|
|
|
| "*)"
|
2008-07-23 04:14:22 -07:00
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
let s = Lexing.lexeme lexbuf in
|
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length s);
|
|
|
|
|
if !comments_level = 1 then
|
|
|
|
|
(
|
2002-03-27 08:20:32 -08:00
|
|
|
|
(* there is just a description *)
|
2002-07-23 07:12:03 -07:00
|
|
|
|
let s2 = lecture_string () in
|
|
|
|
|
let s3 = remove_blanks s2 in
|
2008-07-23 04:14:22 -07:00
|
|
|
|
let s4 =
|
2002-07-23 07:12:03 -07:00
|
|
|
|
if !Odoc_args.remove_stars then
|
|
|
|
|
remove_stars s3
|
|
|
|
|
else
|
|
|
|
|
s3
|
|
|
|
|
in
|
|
|
|
|
Description (s4, None)
|
|
|
|
|
)
|
|
|
|
|
else
|
|
|
|
|
(
|
|
|
|
|
ajout_string s;
|
|
|
|
|
decr comments_level;
|
|
|
|
|
special_comment lexbuf
|
|
|
|
|
)
|
2002-03-27 08:20:32 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
| "(*"
|
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
let s = Lexing.lexeme lexbuf in
|
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length s);
|
|
|
|
|
incr comments_level ;
|
|
|
|
|
ajout_string s;
|
|
|
|
|
special_comment lexbuf
|
2008-07-23 04:14:22 -07:00
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
| "\\@"
|
2008-07-23 04:14:22 -07:00
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
let s = Lexing.lexeme lexbuf in
|
|
|
|
|
let c = (Lexing.lexeme_char lexbuf 1) in
|
2002-03-27 08:20:32 -08:00
|
|
|
|
ajout_char_string c;
|
2002-07-23 07:12:03 -07:00
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length s);
|
2008-07-23 04:14:22 -07:00
|
|
|
|
special_comment lexbuf
|
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
| "@"lowercase+
|
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
(* we keep the description before we go further *)
|
|
|
|
|
let s = lecture_string () in
|
|
|
|
|
description := remove_blanks s;
|
|
|
|
|
reset_string_buffer ();
|
|
|
|
|
let len = String.length (Lexing.lexeme lexbuf) in
|
|
|
|
|
lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_curr_pos - len;
|
2008-07-23 04:14:22 -07:00
|
|
|
|
lexbuf.Lexing.lex_curr_p <-
|
2010-01-22 04:48:24 -08:00
|
|
|
|
{ lexbuf.Lexing.lex_curr_p with
|
|
|
|
|
pos_cnum = lexbuf.Lexing.lex_curr_p.pos_cnum - len
|
|
|
|
|
} ;
|
2002-07-23 07:12:03 -07:00
|
|
|
|
(* we don't increment the Odoc_comments_global.nb_chars *)
|
|
|
|
|
special_comment_part2 lexbuf
|
2008-07-23 04:14:22 -07:00
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
| _
|
2008-07-23 04:14:22 -07:00
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
let c = (Lexing.lexeme_char lexbuf 0) in
|
2002-03-27 08:20:32 -08:00
|
|
|
|
ajout_char_string c;
|
|
|
|
|
if c = '\010' then incr line_number;
|
2002-07-23 07:12:03 -07:00
|
|
|
|
incr Odoc_comments_global.nb_chars;
|
2008-07-23 04:14:22 -07:00
|
|
|
|
special_comment lexbuf
|
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
and special_comment_part2 = parse
|
|
|
|
|
| "*)"
|
2008-07-23 04:14:22 -07:00
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
let s = Lexing.lexeme lexbuf in
|
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length s);
|
|
|
|
|
if !comments_level = 1 then
|
|
|
|
|
(* finally we return the description we kept *)
|
2008-07-23 04:14:22 -07:00
|
|
|
|
let desc =
|
2002-07-23 07:12:03 -07:00
|
|
|
|
if !Odoc_args.remove_stars then
|
|
|
|
|
remove_stars !description
|
|
|
|
|
else
|
|
|
|
|
!description
|
|
|
|
|
in
|
|
|
|
|
let remain = lecture_string () in
|
2008-07-23 04:14:22 -07:00
|
|
|
|
let remain2 =
|
2002-07-23 07:12:03 -07:00
|
|
|
|
if !Odoc_args.remove_stars then
|
|
|
|
|
remove_stars remain
|
|
|
|
|
else
|
|
|
|
|
remain
|
|
|
|
|
in
|
|
|
|
|
Description (desc, Some remain2)
|
|
|
|
|
else
|
|
|
|
|
(
|
|
|
|
|
ajout_string s ;
|
|
|
|
|
decr comments_level ;
|
|
|
|
|
special_comment_part2 lexbuf
|
|
|
|
|
)
|
2002-03-27 08:20:32 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
| "(*"
|
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
let s = Lexing.lexeme lexbuf in
|
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length s);
|
|
|
|
|
ajout_string s;
|
|
|
|
|
incr comments_level ;
|
|
|
|
|
special_comment_part2 lexbuf
|
2008-07-23 04:14:22 -07:00
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
| _
|
2008-07-23 04:14:22 -07:00
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
let c = (Lexing.lexeme_char lexbuf 0) in
|
2002-03-27 08:20:32 -08:00
|
|
|
|
ajout_char_string c;
|
|
|
|
|
if c = '\010' then incr line_number;
|
2002-07-23 07:12:03 -07:00
|
|
|
|
incr Odoc_comments_global.nb_chars;
|
2008-07-23 04:14:22 -07:00
|
|
|
|
special_comment_part2 lexbuf
|
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
and elements = parse
|
|
|
|
|
| [' ' '\013' '\009' '\012'] +
|
2008-07-23 04:14:22 -07:00
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length (Lexing.lexeme lexbuf));
|
|
|
|
|
elements lexbuf
|
2002-03-27 08:20:32 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
| [ '\010' ]
|
|
|
|
|
{ incr line_number;
|
2002-07-23 07:12:03 -07:00
|
|
|
|
incr Odoc_comments_global.nb_chars;
|
|
|
|
|
print_DEBUG2 "newline";
|
2002-03-27 08:20:32 -08:00
|
|
|
|
elements lexbuf }
|
|
|
|
|
|
|
|
|
|
| "@"lowercase+
|
2008-07-23 04:14:22 -07:00
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
let s = Lexing.lexeme lexbuf in
|
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length s);
|
|
|
|
|
let s2 = String.sub s 1 ((String.length s) - 1) in
|
|
|
|
|
print_DEBUG2 s2;
|
|
|
|
|
match s2 with
|
|
|
|
|
"param" ->
|
2008-07-23 04:14:22 -07:00
|
|
|
|
T_PARAM
|
2002-07-23 07:12:03 -07:00
|
|
|
|
| "author" ->
|
|
|
|
|
T_AUTHOR
|
|
|
|
|
| "version" ->
|
|
|
|
|
T_VERSION
|
|
|
|
|
| "see" ->
|
|
|
|
|
T_SEE
|
|
|
|
|
| "since" ->
|
|
|
|
|
T_SINCE
|
2010-05-31 04:52:13 -07:00
|
|
|
|
| "before" ->
|
|
|
|
|
T_BEFORE
|
2002-07-23 07:12:03 -07:00
|
|
|
|
| "deprecated" ->
|
|
|
|
|
T_DEPRECATED
|
|
|
|
|
| "raise" ->
|
|
|
|
|
T_RAISES
|
|
|
|
|
| "return" ->
|
|
|
|
|
T_RETURN
|
|
|
|
|
| s ->
|
|
|
|
|
if !Odoc_args.no_custom_tags then
|
|
|
|
|
raise (Failure (Odoc_messages.not_a_valid_tag s))
|
|
|
|
|
else
|
|
|
|
|
T_CUSTOM s
|
2008-07-23 04:14:22 -07:00
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
| ("\\@" | [^'@'])+
|
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length (Lexing.lexeme lexbuf));
|
|
|
|
|
let s = Lexing.lexeme lexbuf in
|
2008-07-23 04:14:22 -07:00
|
|
|
|
let s = Str.global_replace (Str.regexp_string "\\@") "@" s in
|
|
|
|
|
let s = remove_blanks s in
|
|
|
|
|
print_DEBUG2 ("Desc "^s);
|
|
|
|
|
Desc s
|
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
| eof
|
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
EOF
|
2008-07-23 04:14:22 -07:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
and simple = parse
|
|
|
|
|
[' ' '\013' '\009' '\012'] +
|
2008-07-23 04:14:22 -07:00
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length (Lexing.lexeme lexbuf));
|
|
|
|
|
simple lexbuf
|
2002-03-27 08:20:32 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
| [ '\010' ]
|
|
|
|
|
{ incr line_number;
|
2002-07-23 07:12:03 -07:00
|
|
|
|
incr Odoc_comments_global.nb_chars;
|
2008-07-23 04:14:22 -07:00
|
|
|
|
simple lexbuf
|
2002-03-27 08:20:32 -08:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-23 04:14:22 -07:00
|
|
|
|
| "(**"("*"+)
|
2002-03-27 08:20:32 -08:00
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length (Lexing.lexeme lexbuf));
|
|
|
|
|
incr comments_level;
|
|
|
|
|
simple lexbuf
|
2008-07-23 04:14:22 -07:00
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
| "(*"("*"+)")"
|
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
let s = Lexing.lexeme lexbuf in
|
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length s);
|
|
|
|
|
simple lexbuf
|
2008-07-23 04:14:22 -07:00
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
| "(**"
|
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
let s = Lexing.lexeme lexbuf in
|
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length s);
|
|
|
|
|
incr comments_level;
|
|
|
|
|
simple lexbuf
|
2008-07-23 04:14:22 -07:00
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
| "(*"
|
2008-07-23 04:14:22 -07:00
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
let s = Lexing.lexeme lexbuf in
|
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length s);
|
|
|
|
|
incr comments_level;
|
|
|
|
|
if !comments_level = 1 then
|
|
|
|
|
(
|
|
|
|
|
reset_string_buffer ();
|
|
|
|
|
description := "";
|
2008-07-23 04:14:22 -07:00
|
|
|
|
special_comment lexbuf
|
2002-07-23 07:12:03 -07:00
|
|
|
|
)
|
|
|
|
|
else
|
|
|
|
|
(
|
|
|
|
|
ajout_string s;
|
|
|
|
|
simple lexbuf
|
|
|
|
|
)
|
2002-03-27 08:20:32 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
| eof
|
|
|
|
|
{ EOF }
|
|
|
|
|
|
|
|
|
|
| "*)"
|
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
let s = Lexing.lexeme lexbuf in
|
|
|
|
|
Odoc_comments_global.nb_chars := !Odoc_comments_global.nb_chars + (String.length s);
|
|
|
|
|
decr comments_level ;
|
|
|
|
|
simple lexbuf
|
2008-07-23 04:14:22 -07:00
|
|
|
|
}
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
|
|
| _
|
|
|
|
|
{
|
2002-07-23 07:12:03 -07:00
|
|
|
|
incr Odoc_comments_global.nb_chars;
|
|
|
|
|
simple lexbuf
|
2002-03-27 08:20:32 -08:00
|
|
|
|
}
|