From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id 054033858018 for ; Sun, 8 Aug 2021 11:53:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 054033858018 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-x432.google.com with SMTP id i4so25439wru.0 for ; Sun, 08 Aug 2021 04:53:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to; bh=QjqNzOEVeayjjdURpyi/SvMC5GZ3jvsXDIxNMyL5nP8=; b=NtS4qjQsnhrVYxyGexnKz/qVjeB82zZO8VG/F04yUBMD51nQDcV+pqeKrEzzjICtpY sReMtXe/QEeksQPc1wWOdFmsZlMwDqbSGRWn8tKohuhmrpMvdZcQs0kKU+Nz4f+i1JF8 +ZTGqzS+Wxe479KSw7H1vae1/bLznA+Snd937CjRCcckg7tyzyA2pUTYPVIhzlC5H8zF kb4ojnKuzlfFc+PSRXGS363hoc4QVFEZv/PAjRDLYTLEffWxPdvMUOtPixQy09wK6OIA t2hyZX2Z73fiolm06zqQ5LzDKprbsSpwMsMrKAzbtUkIpojcssqAEG+L45wY66Ekf8Pt qWxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=QjqNzOEVeayjjdURpyi/SvMC5GZ3jvsXDIxNMyL5nP8=; b=DBwoZdM7KM1v+4RUhgh9q67/nHM9b76vFZ7ytpJQYc5n09edtTQngivkv0lb9ar1+C BKGcN0IZMG4YVZiNYYNfSCoWIATxqsjbrSuNhlOdJvWbOK0gbH6kWbmry0Z3I3DjfK0a Q8AehlWjVvE8QvGIxcSRYJj+lFJbp6kBJ20H2Px6PhR+rK+qw17PBiSmhzuRFxCgaO8h sZMalr8BiIRooqewzAvx2Z5YS6V8Thizm7qokVDGrPDgoX+rFMe2hDSyDBzW3dYEdf6H W+821OWJnpXUG5tMe79flMeKsSOuxQdTgQ378VYAC73ySkthOz0RHoRfnb9il/Xh9CuJ jb7Q== X-Gm-Message-State: AOAM532jP0z+DTUJYSsGnylcsU00TRhheagvD/6UFqULfVoo9MXwUQhb Gu2SI4rKG1XrzaJ1yM+gs4hrAL6+XJpq6w== X-Google-Smtp-Source: ABdhPJytG/it/OTqqS6UeSVBsnH7yVHb3sgUBb1csQNbJWoWReZfykZhKJ26csWydPrgQx59h+A1Tg== X-Received: by 2002:a5d:5302:: with SMTP id e2mr6235805wrv.47.1628423637030; Sun, 08 Aug 2021 04:53:57 -0700 (PDT) Received: from [192.168.0.40] ([86.14.124.218]) by smtp.gmail.com with ESMTPSA id j6sm1855812wms.44.2021.08.08.04.53.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 Aug 2021 04:53:56 -0700 (PDT) Subject: Re: [PATCH] Pass pratt parsed token to expr parser functions to fix expr locus To: Mark Wielaard Cc: 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> <32bcf8f9-881e-d57f-470e-5f48fe78e200@embecosm.com> From: Philip Herron Message-ID: <9fc19388-98c4-79db-59d4-e0596bf30a84@embecosm.com> Date: Sun, 8 Aug 2021 12:53:55 +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="EHrKq7hrmE8V1Ju769OwKSzTy2T6XdaPk" X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: Sun, 08 Aug 2021 11:53:59 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EHrKq7hrmE8V1Ju769OwKSzTy2T6XdaPk Content-Type: multipart/mixed; boundary="ahBSXLb5iiQCHxH7RFwq04AiDZY6Gr7SS"; protected-headers="v1" From: Philip Herron To: Mark Wielaard Cc: gcc-rust@gcc.gnu.org Message-ID: <9fc19388-98c4-79db-59d4-e0596bf30a84@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> <32bcf8f9-881e-d57f-470e-5f48fe78e200@embecosm.com> In-Reply-To: --ahBSXLb5iiQCHxH7RFwq04AiDZY6Gr7SS Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US On 07/08/2021 02:01, Mark Wielaard wrote: > On Fri, Aug 06, 2021 at 04:23:27PM +0100, Philip Herron wrote: >> 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-prat= t-parse-loc >>>> The original is also here: >>>> https://code.wildebeest.org/git/user/mjw/gccrs/commit/?h=3Dpass-prat= t-parse-token >>>> >>>> Hopefully one of the two is acceptable. If not please let me know ho= w >>>> 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 directl= y >> associated with the issue you have fixed. The function says that y= ou >> can call me but tell me the location as well so its up to the call= er >> 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? > OK, lets go with the location passing. I added a comment to the > function prototypes in rust-parse.h about the passed in > pratt_parsed_token. > > https://code.wildebeest.org/git/user/mjw/gccrs/commit/?h=3Dpass-pratt-p= arse-token > > Cheers, > > Mark Thanks Mark, I will merge this one. --Phil --ahBSXLb5iiQCHxH7RFwq04AiDZY6Gr7SS-- --EHrKq7hrmE8V1Ju769OwKSzTy2T6XdaPk Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsD5BAABCAAjFiEET83ATZOayqRjyL0Cr7gxHEFOdpkFAmEPxdMFAwAAAAAACgkQr7gxHEFOdpnn TgwAlxHlAE5FuB7ZvGA6Ft3M6sNUZVQPLxVi3c3BTLKmF+CdtwIM7bXoR43kHv2Cc/RxtEz2E2mv Q8snbS3ZXdEb+w2hnnxlSlfKyCxOBnbGI15u9fUcAsTRwDd0lBLNu6FazPQstgjj7T/6pnkmyzlW qxBIh5KahVSGWDwRaEB1mzhwotjW4fsrbtkGcBteXsGR12s9WylRsKXuzpHJXfaDpphOLPUcdHAU RhZsKD3YNNL1gX1I0mkK1gCy5i7mFLtI/ipxneHo3v0EYxjauvXZrbgwbh2yVx1ZadHjwbld7wCv 1Irgof6EpS86H58axZHu83Dgq/eIArMyb0Nrjg/n8k+vCuq/rbHs+iLAtTfqsVgfYBf0WL7cHzKH GvmKt9rMazCJehO/w9oD0fSCXbhvoiyub7Gn64rwB4Kv0Ry1M5/KOea9qXGnbikypY6BLtLUEaRX W2gk9KPD5JvtWtHmtcvZUzgpo8Vr6n+Sm/bNJb7nyMxHSydZce8tOZRioWeW =7z1d -----END PGP SIGNATURE----- --EHrKq7hrmE8V1Ju769OwKSzTy2T6XdaPk--