From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 56E2D7F75C for ; Wed, 13 Aug 2014 18:29:24 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.214.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.214.175 as permitted sender) identity=mailfrom; client-ip=209.85.214.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ob0-f175.google.com) identity=helo; client-ip=209.85.214.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-ob0-f175.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq8BAHiR61PRVdavlGdsb2JhbABaDoNRVwSCdq4+hC6XRodIAYEMCBYQAQEBAQcLCwkSK4QEAQEEEhEEGQEbEgsBAwwGBQsDCgICCR0CAiIBEQEFAQoSBhMSEIgLAQMRDaUQaospgXKDEIokChknAwpmhF4RAQUOgR6OIAeCeYFTBYRSMQWBCIwIgyuEJ4JPgVeMd4Q+GCmES0Q7LwE X-IPAS-Result: Aq8BAHiR61PRVdavlGdsb2JhbABaDoNRVwSCdq4+hC6XRodIAYEMCBYQAQEBAQcLCwkSK4QEAQEEEhEEGQEbEgsBAwwGBQsDCgICCR0CAiIBEQEFAQoSBhMSEIgLAQMRDaUQaospgXKDEIokChknAwpmhF4RAQUOgR6OIAeCeYFTBYRSMQWBCIwIgyuEJ4JPgVeMd4Q+GCmES0Q7LwE X-IronPort-AV: E=Sophos;i="5.01,857,1400018400"; d="scan'208";a="89233960" Received: from mail-ob0-f175.google.com ([209.85.214.175]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 13 Aug 2014 18:29:23 +0200 Received: by mail-ob0-f175.google.com with SMTP id wp18so8509068obc.6 for ; Wed, 13 Aug 2014 09:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=xu+cVYQKPRRWaMrVpogaZDmQ5EvAgPfrjoR/DxqRj20=; b=YmeR26Mf4kwzd+gjjABy5wk+qGOkG/8TobvuvS7CyohWLu4fAFybsoD7LOizUgXk+n PZ+A7fud6k4FFsNEj/L2j7zuwYg4sQOO4djpkNR3AU6KLD4iFf1YijvhqWeyOQvAVee+ GClFXHKK+qk9uOIJ7/06Kz6sPDgmIx3NqCH7/IdbjSvnjFxOgLNf1D37fgHtWEH5jXY1 OKGAOaCzWtezt9pKTTzvGgsh+oKZ0tsS7TpD64hoqoR4RxDFJahAcpMdUJ9AshJa/6xb p84KaAaITWq09Oh5OjC+O+w3kGrft4C8nj0QCuVEZT8N+ZiBz898jKD7hh8s2tQ5NPG2 ncoQ== X-Received: by 10.182.60.225 with SMTP id k1mr6056794obr.48.1407947362241; Wed, 13 Aug 2014 09:29:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.176.73 with HTTP; Wed, 13 Aug 2014 09:28:42 -0700 (PDT) In-Reply-To: <53EB8484.5070907@le.ac.uk> References: <53EB8484.5070907@le.ac.uk> From: Gabriel Scherer Date: Wed, 13 Aug 2014 18:28:42 +0200 Message-ID: To: Andrea Giugliano Cc: caml users Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] Parse error with camlp4 while sources compile Camlp4 uses a different parser technology than the OCaml compiler, so it warns about syntax errors in a different way. It happens sometimes to be wrong, but it is most of the time right, and gives relatively good error message. (In case there is a discrepancy between what the compiler accepts and Camlp4 accept, I recommend that you write code accepted by both.) module A (AO : a) : sig > Parse error: [module_type] expected after ":" (in [module_declaration]) Module type names, as module names, must start with an uppercase letter. Rename the signature into A or ASig, and you will be fine (for this particular error). On Wed, Aug 13, 2014 at 5:30 PM, Andrea Giugliano wrote: > Dear list, > > I am trying to test my ocaml application using a test coverage tool called > bisect (http://bisect.x9c.fr/index.html). > This tool uses camlp4 to instrument the source code, i.e. adding the check > points to say that the source code has been explored by the tests. > When I try to instrument my application, I get the following error from > camlp4: > > Parse error: [module_type] expected after ":" (in [module_declaration]) > Error while running external preprocessor > > Is it possible that camlp4 does not support the functor feature of OCaml? > Has anyone had this error before? > > I googled for the error string and similar errors, but I could not find > anything promising. > I also searched the archives of this mailing list and the wg-camlp4 mailing > list, but nothing similar was present. > The following source files raise the same error (they successfully compile > though!): > > (* test.mli -------------- *) > > module type a = sig > type t > end > > module A (AO : a) : sig > val f : AO.t -> bool > end > > (* test.ml --------------- *) > > module type a = sig > type t > end > > module A (AO : a) = struct > let f ( x : AO.t) = true > end > > let _ = print_endline "test" > (* ------------------------- *) > > I attached them and the Makefile that I am using to create the executable. > If you want to reproduce the error, you need to have installed Ocaml 4.01, > ocamlfind and the last version of bisect > (the most comfortable installation is through OPAM: > opam install ocamlfind > opam install bisect). > Thanks for your attention, > > Andrea Giugliano > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs