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=2.8 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 05F9BBBAF for ; Fri, 11 Sep 2009 16:00:19 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsYBADb1qUrRVdvfkWdsb2JhbACSBYkAPwEBAQEJCwoHEwOve4EqkAsBAwIEhBQFgVQ X-IronPort-AV: E=Sophos;i="4.44,370,1249250400"; d="scan'208";a="34095397" Received: from mail-ew0-f223.google.com ([209.85.219.223]) by mail3-smtp-sop.national.inria.fr with ESMTP; 11 Sep 2009 15:59:35 +0200 Received: by ewy23 with SMTP id 23so1041759ewy.26 for ; Fri, 11 Sep 2009 06:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=XaEYnlViTHapOaBRvmu3qovwW2lG9xjzAM9ipvasXRE=; b=ta5ktIPQeyVrrECoiIiGmvV3tw3a5RCzlp+GoiigXqKme1EWUoJ703NuyFoRzkTZLl Q8z82WqdvTgRfgyFTVS5uxjliQSp7mup6jWuBund9iO/nScHV0rwkP4eyzlHKgI1CGIF u4C/msi+X9WFKCNRYxtaiSoqZ0miNtu8noBzY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=knpx1ZhFR+bhOJyGA7ZPVUFPGbEzCQ44hs/zlj52JXqDzEklEDziCfsxQFBgDmRFqK AMeCiQxJX54jJc07OCwh7qKw2/r/cHW0IP1FNon2S3OPrtbjGDO5cWIHT8xOtk9U0g2A TGMijbxWd+5Ov8Sp6TMt6FfTzoTmzZssk3HaQ= MIME-Version: 1.0 Received: by 10.210.9.7 with SMTP id 7mr3326697ebi.5.1252677574982; Fri, 11 Sep 2009 06:59:34 -0700 (PDT) Date: Fri, 11 Sep 2009 15:59:34 +0200 Message-ID: <4b39c80a0909110659oc950714n809ad4f43cd56a62@mail.gmail.com> Subject: Generating comments from camlp4 From: Alexey Rodriguez To: OCaml List Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; camlp:01 camlp:01 sig:01 sig:01 ocamldoc:01 ocamldoc:01 lexing:01 cheers:01 signatures:01 signatures:01 preprocessor:01 ast:02 declaration:02 declaration:02 output:02 Dear list, Is there a way to generate comments from camlp4 code? We have preprocessors that generate the following kind of code in signatures: > <:sig_item< > $sig_generator the_type_declaration$; > >> However, these extra function signatures show up in the output of ocamldoc which is very annoying. We thought of using "ocamldoc stop" tags (** / **), but we do not know how to generate such comments from camlp4. Do you know of a way to do this: > <:sig_item< > (** / **) > $sig_generator the_type_declaration$; > (** / **) > >> Comments are not part of the AST so I suppose we have to do some hacking at the lexing level. Note that having a dummy preprocessor that generates empty signatures is not an option: this causes type checking errors that require a lot of effort to circumvent. Cheers, Alexey