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 8A0A57FADC for ; Mon, 27 Oct 2014 17:01:05 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of alain@frisch.fr) identity=pra; client-ip=193.252.23.210; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="alain@frisch.fr"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of alain@frisch.fr) identity=mailfrom; client-ip=193.252.23.210; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="alain@frisch.fr"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@msa.smtpout.orange.fr) identity=helo; client-ip=193.252.23.210; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="postmaster@msa.smtpout.orange.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap8BAOlqTlTB/BfSnGdsb2JhbABch0DOZ4MgAoEyAREBAQEBAQgLCQkULoQDAQEEIw8BBUARCw4KAgIFFgsCAgkDAgECAUUGAQwIAQGIQbcVlFkBCyCBLI8pOoJ3gVQFnWGHbIR+i0IgFoFFgzYBAQE X-IPAS-Result: Ap8BAOlqTlTB/BfSnGdsb2JhbABch0DOZ4MgAoEyAREBAQEBAQgLCQkULoQDAQEEIw8BBUARCw4KAgIFFgsCAgkDAgECAUUGAQwIAQGIQbcVlFkBCyCBLI8pOoJ3gVQFnWGHbIR+i0IgFoFFgzYBAQE X-IronPort-AV: E=Sophos;i="5.04,796,1406584800"; d="scan'208";a="103193961" Received: from msa01.smtpout.orange.fr (HELO msa.smtpout.orange.fr) ([193.252.23.210]) by mail2-smtp-roc.national.inria.fr with ESMTP; 27 Oct 2014 17:01:05 +0100 Received: from [192.168.1.132] ([92.151.48.65]) by mwinf5d25 with ME id 8G141p0011QPSXw03G14sP; Mon, 27 Oct 2014 17:01:04 +0100 X-ME-Helo: [192.168.1.132] X-ME-Auth: bGV4aWZpQHdhbmFkb28uZnI= X-ME-Date: Mon, 27 Oct 2014 17:01:04 +0100 X-ME-IP: 92.151.48.65 Message-ID: <544E6C43.6090201@frisch.fr> Date: Mon, 27 Oct 2014 17:01:07 +0100 From: Alain Frisch User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Jan Rehders , caml-list References: 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/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