From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id C7E9939A1839 for ; Fri, 6 Aug 2021 15:23:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C7E9939A1839 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x42d.google.com with SMTP id b13so11566151wrs.3 for ; Fri, 06 Aug 2021 08:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=to:references:from:subject:message-id:date:user-agent:mime-version :in-reply-to; bh=ozlnhNVtdfC7+RWcq/hkDgXe7MgRipVUZTEabgglM/Q=; b=cm/RagCryVk0IdmfpDjElzYOVpJvLV2sFc18Ef1XfZEV7ZSaY9LRq9DJgOHrBxFuUj khS9lBj1ryMJq3pCTojgODDHU9AGvg9mpH0ZAXpqxrZCjBAbQ9m4rUQ/tteIdPsH2Dje K9acmSvMcJSKWmovinqXeahEF8683Xzz3AY9SlMFkMHqjwhDXJCCJZI4SBwWi11XAJpz OC2GYwwLr+CTWHc4GTff3jjYUiuesriZJne09+yluzWROlXJOSU2sw2pis2KcF1P9E7l D/3lDw/wOhEM/bBY/RM6XzhMO8hm+LFFVPhLXUWxqzuTVwjbzO2VL7c86KYFGyawoUBe bjDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to; bh=ozlnhNVtdfC7+RWcq/hkDgXe7MgRipVUZTEabgglM/Q=; b=ErcOFKDJfARdHVZVAqwqkTV3Kzq2wYr1el9+J3quHU96ARUQ1J30WtlTrWpskAzJ+q CNHfx+55CTAbU5TbWzAocq3ZuAFDYYZ882qKDwYeXaWlnK8pWLDthKOTB+FxBiaVBoju T0Cqa9zbMDouk+uotDhXc6aE1Coi2tcyN/B73ya+V8cf4Q4YcrOKokK9t/VpPfD5Wg3O lYRg+VnY3XjKD9m7nj4tUU1D61xgeQY4+ZVL8b9IbEEtuPnM4iosUp7IGnb77nTQIthv 4LlERpTRKoxwqolSdcZPUaFcBDcqZRcK6eGDXx1yHtpeyqkT/wC9DNUkkpV7X2XFrDnb bD4Q== X-Gm-Message-State: AOAM533APe3RNE9PObr1aVM6i19qF2q1sjp/D6l5Tb7gKWb9RuB6y4Hn U90RGzE34npBJ9oinZ1fpcyumW/dUNFAaw== X-Google-Smtp-Source: ABdhPJzsG02L8Bx893gJHtlfes7NIEUzM+Ym9EEUxOjLXvsNx/iejTGRZro5Lq7/Lf5liZZTAOKL8w== X-Received: by 2002:a5d:58ec:: with SMTP id f12mr11832414wrd.247.1628263408491; Fri, 06 Aug 2021 08:23:28 -0700 (PDT) Received: from [192.168.0.40] ([86.14.124.218]) by smtp.gmail.com with ESMTPSA id z12sm8700173wml.18.2021.08.06.08.23.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Aug 2021 08:23:28 -0700 (PDT) To: gcc-rust@gcc.gnu.org References: <20210728221342.77649-1-mark@klomp.org> <01C0429E-15F9-45A7-B800-400EEBDF13CD@gmail.com> <9c9db19145176d664a6e944c1ff7108ce61215ae.camel@klomp.org> <87r1fh9mhx.fsf@euler.schwinge.homeip.net> From: Philip Herron Subject: Re: [PATCH] Pass pratt parsed token to expr parser functions to fix expr locus Message-ID: <32bcf8f9-881e-d57f-470e-5f48fe78e200@embecosm.com> Date: Fri, 6 Aug 2021 16:23:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LuuAcZwtNwokRwx88Jbk0YM3uTdcqSyJj" X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-rust@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: gcc-rust mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 15:23:31 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LuuAcZwtNwokRwx88Jbk0YM3uTdcqSyJj Content-Type: multipart/mixed; boundary="D9VRdKjXy9wGAQntFcA4KEegyaEKXXUoF"; protected-headers="v1" From: Philip Herron To: gcc-rust@gcc.gnu.org Message-ID: <32bcf8f9-881e-d57f-470e-5f48fe78e200@embecosm.com> Subject: Re: [PATCH] Pass pratt parsed token to expr parser functions to fix expr locus References: <20210728221342.77649-1-mark@klomp.org> <01C0429E-15F9-45A7-B800-400EEBDF13CD@gmail.com> <9c9db19145176d664a6e944c1ff7108ce61215ae.camel@klomp.org> <87r1fh9mhx.fsf@euler.schwinge.homeip.net> In-Reply-To: --D9VRdKjXy9wGAQntFcA4KEegyaEKXXUoF Content-Type: multipart/alternative; boundary="------------F62BB6C11FFE858B3ACA2A93" Content-Language: en-US This is a multi-part message in MIME format. --------------F62BB6C11FFE858B3ACA2A93 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/08/2021 20:37, Mark Wielaard wrote: > Hi, > > On Fri, Jul 30, 2021 at 03:03:13AM +0200, Mark Wielaard wrote: >> That variant is attached and can also be found here: >> https://code.wildebeest.org/git/user/mjw/gccrs/commit/?h=3Dpass-pratt-= parse-loc >> The original is also here: >> https://code.wildebeest.org/git/user/mjw/gccrs/commit/?h=3Dpass-pratt-= parse-token >> >> Hopefully one of the two is acceptable. If not please let me know how >> to rewrite it in a cheaper more idiomatic way. > Any feedback on these patches? I really like to get the locations > correct for these pratt parsed expressions. If both variants are > problematic please let me know what I can do to improve them. > > Thanks, > > Mark > Hi Mark, Sorry for lack of reply on this. After looking into this and also getting Arthur Cohen to review, I think: * Token passing: If we end up using the token for more than the location this might be useful but at present I can't think of a use-case for the token. If we do need it maybe we could look into passing it by reference. * Location passing: I think this is the best solution and is directly associated with the issue you have fixed. The function says that you can call me but tell me the location as well so its up to the caller to handle this. We should add a comment to the function prototypes to say what the location is but that's it. What do you think? Thanks --Phil --------------F62BB6C11FFE858B3ACA2A93 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
On 05/08/2021 20:37, Mark Wielaard wrote:
Hi,

On Fri, Jul 30, 2021 at 03:03:13AM +0200, Mark Wielaard wrote:
That variant is attached a=
nd can also be found here:
https://code.wildebees=
t.org/git/user/mjw/gccrs/commit/?h=3Dpass-pratt-parse-loc
The original is also here:
https://code.wildebe=
est.org/git/user/mjw/gccrs/commit/?h=3Dpass-pratt-parse-token

Hopefully one of the two is acceptable. If not please let me know how
to rewrite it in a cheaper more idiomatic way.
Any feedback on these patches? I really like to get the locations
correct for these pratt parsed expressions. If both variants are
problematic please let me know what I can do to improve them.

Thanks,

Mark

Hi Mark,

Sorry for lack of reply on this. After looking into this and also getting Arthur Cohen to review, I think:

  • Token passing: If we end up using the token for more than the location this might be useful but at present I can't think of a use-case for the token. If we do need it maybe we could look into passing it by reference.
  • Location passing: I think this is the best solution and is directly associated with the issue you have fixed. The function says that you can call me but tell me the location as well so its up to the caller to handle this. We should add a comment to the function prototypes to say what the location is but that's it.

What do you think?

Thanks

--Phil

--------------F62BB6C11FFE858B3ACA2A93-- --D9VRdKjXy9wGAQntFcA4KEegyaEKXXUoF-- --LuuAcZwtNwokRwx88Jbk0YM3uTdcqSyJj Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsD5BAABCAAjFiEET83ATZOayqRjyL0Cr7gxHEFOdpkFAmENU+8FAwAAAAAACgkQr7gxHEFOdpmf Ggv/V+uG2+nL1qs8UEqTvL/MVdpGK2YVpZ6A+iwGM3nw+X2AddcmohvebeNO9M1YweyY/UjKPq68 RqIm3Ji42Ah+4gpr2+PxS4BqLP73WwEFt+Hhdb++mumPWlEzoavRnOglGyNh95dAcTPI8Ks+xUHo hyLU8XDLdWUVYFthJPWa+dC4KdVfh9Y00lbxe0l/KmKXzQ6aDeC0vr5LMpI2S1OkvmgXq/E4pne0 QPYxnGnbVb6/H6w/+2NN5LB091WYuV1LKhVeQOEYSR7rQwNlndMHsWM1ncDWdBPykXkpepxEAoCi H6gf+AeGdeYOkIPMLmrRhaYDq2VrxyFAYm8JaLeDBVe4velVJ9DQrDoQEBl2n9QW/XPuQ0JPX/bH VkM1jAO+VKBTPqgm9gpfV2pyR9+JBTYDebaPJNnCe3eh/bMAgdIltYXayQszaC7qGojRifIo7CDy qt11YohaGGK42T0TONVI8i0eVlLPEFPJnETZS0cDRFO/G/PKUSAbK8RBda1A =i/Jh -----END PGP SIGNATURE----- --LuuAcZwtNwokRwx88Jbk0YM3uTdcqSyJj--