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 822157EFCD for ; Tue, 28 Oct 2014 10:13:36 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.04,801,1406584800"; d="scan'208";a="103313493" Received: from meleze.ens.fr (HELO [129.199.99.114]) ([129.199.99.114]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 28 Oct 2014 10:13:36 +0100 Message-ID: <544F5E40.3040201@inria.fr> Date: Tue, 28 Oct 2014 10:13:36 +0100 From: Francois Berenger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: caml-list@inria.fr References: <544E6C43.6090201@frisch.fr> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] Beta release of ppx_string_interpolate, and help needed with ocamlfind/opam On 10/28/2014 12:36 AM, Jan Rehders wrote: > Alain: yes, for the new string literals this issue does not exist (and > they are already supported). But I'd like to keep support for regular > strings, too. I guess I could also simply expand something like > {istr|...|istr} but I think transforming anything that isn't in "my" > annotations is a bad idea. > > Btw: anyone tried to use this with opam? I still couldn't get > ocamlfind to find the package after installation (see first mail). Not sure it will resolve your issue but, in case you wrote your META file by hand and it is erroneous, there are tools out there that generate the META file automatically for a project: oasis, ocamlbuild and obuild, for example. > On Mon, Oct 27, 2014 at 5:01 PM, Alain Frisch wrote: >> On 10/26/2014 07:20 PM, Jan Rehders wrote: >>> >>> = Using \ instead of $ = >>> Using Swift style \(foo) instead of $(foo) would be nice but will >>> produce warnings from the lexer which I can't suppress w/o suppressing >>> all warnings about invalid escape sequences. Also this requires doing >>> this from the makefile so every user would have to do it. Is there >>> some API I’ve missed to suppress specific warnings on the code inside >>> [%str ..] from ppx filters? >> >> >> You might want to use the new syntax for string literals: >> >> {| .... |} >> >> or: >> >> {id| .... |id} >> >> (for an arbitrary id). Contrary to regular string literals, OCaml doesn't >> apply any lexing convention to the string contents: what you have in the >> Parsetree is exactly the sequence of bytes from the source file. This >> allows you to use you own conventions: >> >> \(foo) >> >> Also, you can map in an exact way between from an index in the string to a >> location in the source code (in a regular string, you cannot distinguish >> \065 from A in the Parsetree, which makes this exact mapping impossible). >> >> >> Combined with an extension node, this would give: >> >> [%str{| blabla \(x) blabla |}] >> >> -- Alain > -- Regards, Francois.