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 015F87F75C for ; Thu, 14 Aug 2014 00:43:10 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of ag400@leicester.ac.uk) identity=pra; client-ip=143.210.16.37; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ag400@leicester.ac.uk"; x-sender="ag400@leicester.ac.uk"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of ag400@leicester.ac.uk) identity=mailfrom; client-ip=143.210.16.37; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ag400@leicester.ac.uk"; x-sender="ag400@leicester.ac.uk"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@gemsbok.le.ac.uk) identity=helo; client-ip=143.210.16.37; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ag400@leicester.ac.uk"; x-sender="postmaster@gemsbok.le.ac.uk"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai4CAMTp61OP0hAlnGdsb2JhbABag19XgnqrUgaCaptyh0gBgQ0WEAEBAQEBCAsJCRQphAQBBSMEETYKARALGAICBQQSCwICCQMCAQIBMxIGDQEFAgEBDogcAxEECbFNj2gDYYRxF4EshFCJUAeCeYFTBYRSMQWBCI8zhCeEJox3ig1rAQ X-IPAS-Result: Ai4CAMTp61OP0hAlnGdsb2JhbABag19XgnqrUgaCaptyh0gBgQ0WEAEBAQEBCAsJCRQphAQBBSMEETYKARALGAICBQQSCwICCQMCAQIBMxIGDQEFAgEBDogcAxEECbFNj2gDYYRxF4EshFCJUAeCeYFTBYRSMQWBCI8zhCeEJox3ig1rAQ X-IronPort-AV: E=Sophos;i="5.01,858,1400018400"; d="scan'208";a="89264433" Received: from gemsbok.le.ac.uk ([143.210.16.37]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 14 Aug 2014 00:43:06 +0200 Received: from cpc22-nfds13-2-0-cust173.8-2.cable.virginm.net ([86.24.145.174]:38397 helo=[192.168.0.9]) by gemsbok.le.ac.uk with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XHhG5-00042F-55; Wed, 13 Aug 2014 23:43:05 +0100 Message-ID: <53EBE9F8.1050005@le.ac.uk> Date: Wed, 13 Aug 2014 23:43:04 +0100 From: Andrea Giugliano User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Gabriel Scherer CC: caml users References: <53EB8484.5070907@le.ac.uk> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-UoL-Id: 57d4b8d6cea2a176c9122a9c0b1e6abc@1XHhG5-00042F-55@gemsbok.le.ac.uk X-Authenticated-User: ag400 X-Validation-by: ag400@leicester.ac.uk Subject: Re: [Caml-list] Parse error with camlp4 while sources compile Hello, thanks a lot for your help! This solved my problem, and I learned also that it is bad style to write module names. Thanks again, Andrea On 13/08/14 17:28, Gabriel Scherer wrote: > 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