From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 69279BBAF for ; Tue, 10 Mar 2009 12:38:46 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhQCAKvutUnCpx6vmWdsb2JhbACVKwEBAQEBCAsKBxG9MIQFBg X-IronPort-AV: E=Sophos;i="4.38,336,1233529200"; d="scan'208";a="22315883" Received: from smtpka.univ-orleans.fr (HELO ka.univ-orleans.fr) ([194.167.30.175]) by mail2-smtp-roc.national.inria.fr with ESMTP; 10 Mar 2009 12:38:46 +0100 Received: from smtps.univ-orleans.fr (localhost [127.0.0.1]) by ka.univ-orleans.fr (Postfix) with ESMTP id 2ED3D12AD62 for ; Tue, 10 Mar 2009 12:38:46 +0100 (CET) Received: from [192.168.0.12] (lau18-1-82-246-197-195.fbx.proxad.net [82.246.197.195]) by smtps.univ-orleans.fr (Postfix) with ESMTP id 4A1D336E60 for ; Tue, 10 Mar 2009 12:38:47 +0100 (CET) Subject: Extracting a subsignature with comments From: David Rajchenbach-Teller To: OCaml Content-Type: text/plain; charset=UTF-8 Date: Tue, 10 Mar 2009 12:39:10 +0100 Message-Id: <1236685150.7428.16.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; ens-lyon:01 ocaml:01 mli:01 submodule:01 mli:01 submodule:01 ocamldoc:01 sig:01 sig:01 camlp:01 ocaml:01 node:01 ocamldoc:01 univ-orleans:01 lifo:01 Dear list, After a few experiments based on the indications of Martin Jambon and Daniel Bünzli, it seems that, to get the correct type signatures for OCaml Batteries Included, we'll need 1) either to write the signature of the whole library manually (in addition to having written the signature of each individual module) 2) or to be able to generate a signature programmatically based the contents of existing signatures. If possible, I'd like to take the second approach. For this purpose, I'll need to be able to analyse a .mli, extract a submodule and produce a new .mli from that submodule -- while keeping all the comments involved, to allow further manipulation by ocamldoc. For instance, in Batteries, we have a file extList.mli, which looks roughly like: « (** Some module comment *) module List : sig (**The type of lists*) type 'a t = 'a list (*etc.*) (**Some other module comment*) module Labels : sig (*etc.*) end end » >>From this .mli, I'd like to be able to extract both module List and module List.Labels. Extracting module List would produce something along the lines of « (** Some module comment *) (**The type of lists*) type 'a t = 'a list (*etc.*) (**Some other module comment*) module Labels : sig (*etc.*) end » Extracting module List.Labels would produce something along the lines of « (**Some other module comment*) (*etc.*) » Now, that's a long and ingrate task. So here's me, hoping that someone has already done it for me, or could advise a tool which could help me. Any suggestion? Note that Camlp4 does not seem applicable (at least not as of OCaml 3.11) as it doesn't track which comments are associated to which node, which often causes it to detach a ocamldoc comment from a declaration and attach it to another one. Thanks in advance, David -- David Teller-Rajchenbach Security of Distributed Systems http://www.univ-orleans.fr/lifo/Members/David.Teller « Ce matin Un crétin A tué un chercheur. » (air connu) Latest News of French Research: System being liquidated. Researchers angry.