From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 2AC5280211 for ; Thu, 19 Oct 2017 13:01:49 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=refis.thomas@gmail.com; spf=Pass smtp.mailfrom=refis.thomas@gmail.com; spf=None smtp.helo=postmaster@mail-qt0-f179.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of refis.thomas@gmail.com) identity=pra; client-ip=209.85.216.179; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="refis.thomas@gmail.com"; x-sender="refis.thomas@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of refis.thomas@gmail.com designates 209.85.216.179 as permitted sender) identity=mailfrom; client-ip=209.85.216.179; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="refis.thomas@gmail.com"; x-sender="refis.thomas@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-qt0-f179.google.com) identity=helo; client-ip=209.85.216.179; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="refis.thomas@gmail.com"; x-sender="postmaster@mail-qt0-f179.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3A5j9XnRG1mvfIoOY3mc9pEZ1GYnF86YWxBRYc798d?= =?us-ascii?q?s5kLTJ76oMmwAkXT6L1XgUPTWs2DsrQf1LqQ7viocFdDyKjCmUhKSIZLWR4BhJ?= =?us-ascii?q?detC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TXhpQIVTzD2KQd3?= =?us-ascii?q?bsfy6AvRx5Cy3uG205jafwhKwTm6erJxahO7sVOCmNMRhN5eKqE0wwCBmHZGev?= =?us-ascii?q?8ekX9oIleahFDm68mx57Zs9i1Rv7Qq8MsWAvayRLgxUbENVGduCGsy/sC+7RQ?= =?us-ascii?q?=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CbAgCzhehZf7PYVdFdHRgHDBgHhAxuJ?= =?us-ascii?q?weDc4E2mCKBeok5jxgjhRiFAwdDFAEBAQEBAQEBAQEBEgEBCQsLCCYxgjgigkQ?= =?us-ascii?q?BBAEjHQEbHQEDAQsBBQMCBAEGNwICIgERAQUBHAYTCIl/AQMNCBCNCpEbQIwMg?= =?us-ascii?q?gUFARyDCQWDYgoZJw1YgwEBAQgBAQEBHAIBBRKDHYIHgVGFGIRlAQFLgmeCYQW?= =?us-ascii?q?hU4IvhTKNDpMZlWAUBR+BFTZjgRk0ISVeNYIvgQKDXj82iDGCNQEBAQ?= X-IPAS-Result: =?us-ascii?q?A0CbAgCzhehZf7PYVdFdHRgHDBgHhAxuJweDc4E2mCKBeok?= =?us-ascii?q?5jxgjhRiFAwdDFAEBAQEBAQEBAQEBEgEBCQsLCCYxgjgigkQBBAEjHQEbHQEDA?= =?us-ascii?q?QsBBQMCBAEGNwICIgERAQUBHAYTCIl/AQMNCBCNCpEbQIwMggUFARyDCQWDYgo?= =?us-ascii?q?ZJw1YgwEBAQgBAQEBHAIBBRKDHYIHgVGFGIRlAQFLgmeCYQWhU4IvhTKNDpMZl?= =?us-ascii?q?WAUBR+BFTZjgRk0ISVeNYIvgQKDXj82iDGCNQEBAQ?= X-IronPort-AV: E=Sophos;i="5.43,401,1503352800"; d="scan'208,217";a="296965439" Received: from mail-qt0-f179.google.com ([209.85.216.179]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 19 Oct 2017 13:01:32 +0200 Received: by mail-qt0-f179.google.com with SMTP id z50so13862553qtj.4 for ; Thu, 19 Oct 2017 04:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=VxTQdShaoG8fTo5F4j/hyFk1eKY4VMtLsQNLetQbd8Q=; b=epOp6MOY1uWx1Zm2vNGOJQdwfUbXqzvcFH9ndWVa/pF4RYQONfini98Ql8v1ZOzh8X fLQPVcd7SQ/lgUEbVsm7BggPkmUIZm6wVCbI8lmsVT+SxA4XQjTFUdapl5pIAE7fBDkJ t5SP4t9QxMgSC6kxnXIen0OSqHTtofW++1yjNxUOm+bYgZ8357/xd2dsmLU/EUYrl4yA F4IVAHoMDe1vPEyUyq08jFmv8eD8x6L3kwJXwMoQKK+If2KCOPuRX0wRaNGGWOPW06RU Or23nXSl7Lc3F9I6IWqFPiEXBHwv1Yy8ZwqOOfmKKW9wy9zPRiC8zzsddNwTntN/1VbN Y+jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=VxTQdShaoG8fTo5F4j/hyFk1eKY4VMtLsQNLetQbd8Q=; b=Mc+aPWsRVw/07j1fudE27HQtJ+8wPIMbjeEMoCekUoLE/C8QY0qewkt1Lq7pv3cMeO JUiNLztAST1CW3wIAUgsrceEjdHzL0bSnlCovbLPSwxEgq++FPkdZeg2QnLIQ463vpOZ yJY4rZBq23lITHXOYmzYtO3JOd1p3bgqVHYW/O5JI8jbwrcg96ThNP/U1jMTUmtJi+CL NeVxy4W5XsG83qknBd0w/aI0Ur8zTrbGYYESIn0WYqpZMHVUpZljX8Kj6WJIf7ejFjpD XbgmnI2LvZS0JqznlZD/4FtokmC/4ArKNrowWQq8Kr/t0wwU0AeiG8JY7S9puVbe+Uop Zq9Q== X-Gm-Message-State: AMCzsaVLPh1OJCeN+wX2C9GGJKsXImxS6F2jB/Ml5f3/wLsnY5kK60Zb W0oKXWe0ksfr0z6D1VRI3RbkiAYot3ZpIpmvy3bHmQ== X-Google-Smtp-Source: ABhQp+Sg46FtQnnos1AcxuX7fD+3H+zQjrZyG02F5Qs4l63dnzOSQcDmjH7Z2c1ahIZEUJH+7XW+1ZCQccqHRXZVHt0= X-Received: by 10.200.52.118 with SMTP id v51mr1326275qtb.266.1508410891243; Thu, 19 Oct 2017 04:01:31 -0700 (PDT) MIME-Version: 1.0 Sender: refis.thomas@gmail.com Received: by 10.140.17.167 with HTTP; Thu, 19 Oct 2017 04:01:30 -0700 (PDT) In-Reply-To: <59fb8cd9-0b10-b3a8-7ebf-d7a0b5d1583a@matej-kosik.net> References: <59fb8cd9-0b10-b3a8-7ebf-d7a0b5d1583a@matej-kosik.net> From: Thomas Refis Date: Thu, 19 Oct 2017 12:01:30 +0100 X-Google-Sender-Auth: PDm7WReYncKV8Wp4dGZTNYeYMlw Message-ID: To: =?UTF-8?B?TWF0ZWogS2/FocOtaw==?= Cc: caml users Content-Type: multipart/alternative; boundary="001a113966fc5912d5055be44718" X-Validation-by: thomas.refis@gmail.com Subject: Re: [Caml-list] how to get location of a polymorphic variant via compiler libs --001a113966fc5912d5055be44718 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable https://github.com/ocaml/ocaml/blob/trunk/parsing/parsetree.mli#L144 2017-10-19 11:55 GMT+01:00 Matej Ko=C5=A1=C3=ADk : > Hi, > > I am using compiler-libs for getting locations of lexical items I am > interested in. > (modules, values, types, non-polymorphic variants, record labels). > > If I have a code like this: > > type t =3D [`Foo | `Bar] > > does the parse-tree hold the location of "`Foo" (or "`Bar") somewhere? > > (I am not interested in the location of the whole type definition --- just > the location of a specific polymorphic variant/constructor.) > > The attachment display the available parse-tree I can see > (and not able to find bits I am interested in) > --001a113966fc5912d5055be44718 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

2017-10-19 11:55 GMT+01:00 Matej Ko=C5=A1=C3=ADk <mail@mat= ej-kosik.net>:
Hi,

I am using compiler-libs for getting locations of lexical items I am intere= sted in.
(modules, values, types, non-polymorphic variants, record labels).

If I have a code like this:

=C2=A0 type t =3D [`Foo | `Bar]

does the parse-tree hold the location of "`Foo" (or "`Bar&qu= ot;) somewhere?

(I am not interested in the location of the whole type definition --- just = the location of a specific polymorphic variant/constructor.)

The attachment display the available parse-tree I can see
(and not able to find bits I am interested in)

--001a113966fc5912d5055be44718--