From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_Paulo_Labegalini_de_Carvalho?= Newsgroups: gmane.emacs.devel Subject: Re: Code navigation for sh-mode with Tree-sitter Date: Tue, 6 Dec 2022 18:12:25 -0700 Message-ID: References: <1B9F9B3A-A757-4A65-9653-CD0112EB8895@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000b7d3f805ef329d58" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14318"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Alan Mackenzie , Yuan Fu , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 07 02:13:21 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2izw-0003W5-Va for ged-emacs-devel@m.gmane-mx.org; Wed, 07 Dec 2022 02:13:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2izN-0006KS-Ny; Tue, 06 Dec 2022 20:12:47 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2izK-0006K7-Co for emacs-devel@gnu.org; Tue, 06 Dec 2022 20:12:42 -0500 Original-Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p2izH-0003iM-FD for emacs-devel@gnu.org; Tue, 06 Dec 2022 20:12:41 -0500 Original-Received: by mail-ej1-x62e.google.com with SMTP id fc4so10416358ejc.12 for ; Tue, 06 Dec 2022 17:12:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/n7KOXoYys7/Lsq1OKJaKholO9YI7WDp2p82zAsOr+c=; b=INNJdmEhVsFfapp43k1jhJrStAKYE18gox4e97KQporOJ5ZCIUxW1zaka4hYWVgdU7 SYz9hwePb1a99n4kYA190jb6256Q44OwDvESHJ2gg3wMxKnkyPCyWDpjneM1mjYFHDX0 utJnZXkqxOEDQSoXhTkR3qOa//LRTtiZl57AExSuzsPkI6B52YsKMfKlaVToQrrEj+Tw AFoc3KKC2Xl3+Nv/30jLgtum8uHZcdysqu2jjZUU2NRXtbX3EIwBRh1ORRFCv4CHHSmo 1Rbl9195X2w9Aq9ORNFNWVViYMUHtfBMnw42OWMOFFHzA7ragLdIQK2zlFIKORg5vpV2 KFDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/n7KOXoYys7/Lsq1OKJaKholO9YI7WDp2p82zAsOr+c=; b=oGRtCeyBj9cos2crswzZ3c9Og0E7ohRXFgml2aOzZC5griyFdA68wyo8JvGNvnAb64 0FlWuNuClaUBSMeiAY5YV58+nJ9rNVSQl2NLf8v7xeM1AWoowOY+LbQzlq1SbwPCLMxh vJiT0oNpY0OyPvoIJI/9zSVsCrUvIpG288S5O5sFSFe6yYeGRfqKroOu3oVrPeXRf5nX SCJhOox7qTz3LAc9ARbABfFM3vqiUeSIsoP9l+xl5A73BTgIE7jfpcHwHMsBBU3Shsd9 TGSbGevdbuYx+eTA9BvLN6aJMvTAhqTFGObkHbkk+2aKYUguTRD9uN/Jarw+Uxw65usX Gkrg== X-Gm-Message-State: ANoB5pm/oiC9juijB3Rh6GszCMGkJ6rZe2dNUTaO4VBFuTD/oSMWwd7s QvlmgGWBc5LASzBPfKmSNtP2mvz+pHh7SHOX2vY= X-Google-Smtp-Source: AA0mqf4fIfaAJrg9nlZCf7sMjccA8ZLphVgMuRHd/fRkZx9pG5cttp9ZaJDZ69lKuyxpEfPDn13hGnojswyUxtRKI4E= X-Received: by 2002:a17:906:2810:b0:7b2:7b45:2bf6 with SMTP id r16-20020a170906281000b007b27b452bf6mr58955235ejc.467.1670375557018; Tue, 06 Dec 2022 17:12:37 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=jaopaulolc@gmail.com; helo=mail-ej1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300998 Archived-At: --000000000000b7d3f805ef329d58 Content-Type: multipart/alternative; boundary="000000000000b7d3f305ef329d56" --000000000000b7d3f305ef329d56 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Dec 6, 2022 at 4:50 PM Stefan Monnier wrote: > > However, with negative arguments that does not happen, as > > `sh-mode--treesit-beginning-of-defun' moves point to (beginning of) the > > closest sibling function (after point) and > > `sh-mode--treesit-end-of-defun' moves > > point to (end of) the closest sibling function (before point). In this > > case, the selected functions to which point move to are not the same. > > Please read the docstring of `end-of-defun-function`, because I suspect > that you are confused about what it's supposed to do. E.g. it's not > supposed to "move point to (end of) the closest sibling function", so > I think you'll need to set it to a different function than > `sh-mode--treesit-end-of-defun`. > Indeed. I was trying to impose the behavior I desired to achieve instead of the intended use. I corrected that in my patch. Looking forward to comments and suggestions for the patch. --=20 Jo=C3=A3o Paulo L. de Carvalho Ph.D Computer Science | IC-UNICAMP | Campinas , SP - Brazil Postdoctoral Research Fellow | University of Alberta | Edmonton, AB - Canad= a joao.carvalho@ic.unicamp.br joao.carvalho@ualberta.ca --000000000000b7d3f305ef329d56 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Dec 6, 2022 at 4:50 PM Stefan= Monnier <monnier@iro.umontr= eal.ca> wrote:
> However, with negative arguments that does not happen, as
> `sh-mode--treesit-beginning-of-defun' moves point to (beginning of= ) the
> closest sibling function (after point) and
> `sh-mode--treesit-end-of-defun' moves
> point to (end of) the closest sibling function (before point).=C2=A0 I= n this
> case, the selected functions to which point move to are not the same.<= br>
Please read the docstring of `end-of-defun-function`, because I suspect
that you are confused about what it's supposed to do.=C2=A0 E.g. it'= ;s not
supposed to "move point to (end of) the closest sibling function"= , so
I think you'll need to set it to a different function than
`sh-mode--treesit-end-of-defun`.

Indeed. I was try= ing to impose the behavior I desired to achieve instead of the intended use= . I corrected that in my patch.=C2=A0

Looking forward to comments an= d=C2=A0suggestions for the patch.

--
Jo=C3=A3o Paulo L. de Carvalho
Ph.D Computer Science | =C2=A0IC-UN= ICAMP | Campinas , SP - Brazil
Postdoctoral Research Fellow | University= of Alberta | Edmonton, AB - Canada
--000000000000b7d3f305ef329d56-- --000000000000b7d3f805ef329d58 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Basic-navigation-for-bash-ts-mode.patch" Content-Disposition: attachment; filename="0001-Basic-navigation-for-bash-ts-mode.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lbcyg3ok0 RnJvbSBlNTQzMGIxM2ZlN2YzOTQ1ODY0ZTE5NGM5MjA3ZWQxYTVlMDI4MzVmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/Sm89QzM9QTNvPTIwUD0yRT0yMEw9MkU9MjBk ZT0yMENhcnZhbGhvPz0KIDxqYW9wYXVsb2xjQGdtYWlsLmNvbT4KRGF0ZTogU2F0LCAzIERlYyAy MDIyIDEyOjU1OjI3IC0wNzAwClN1YmplY3Q6IFtQQVRDSF0gQmFzaWMgbmF2aWdhdGlvbiBmb3Ig YmFzaC10cy1tb2RlCgpFbmFibGVzIG5hdmlnYXRpb24gdG8gYmVnaW5uaW5nL2VuZCBvZiBmdW5j dGlvbiBpbiBiYXNoLXRzLW1vZGUuCiAgKiBsaXNwL3Byb2dtb2Rlcy9zaC1zY3JpcHQuZWwgKGJh c2gtdHMtbW9kZSk6IGVuYWJsZSBuYXZlZ2F0aW9uIHZpYQogIGBiZWdpbm5pbmctb2YtZGVmdW4t ZnVuY3Rpb24nICYgYGVuZC1vZi1kZWZ1bi1mdW5jdGlvbicuCiAgKHNoLW1vZGUtdHJlZXNpdC1i ZWdpbm5pbmctb2YtZGVmdW4pCiAgKHNoLW1vZGUtdHJlZXNpdC1lbmQtb2YtZGVmdW4pCiAgKHNo LW1vZGUtLXRyZWVzaXQtZW5kLW9mLWRlZnVuLWZ1bmN0aW9uKQogIChzaC1tb2RlLS10cmVlc2l0 LWRlZnVuLXApCiAgKHNoLW1vZGUtLXRyZWVzaXQtbm90LXNjLXApCiAgKHNoLW1vZGUtLXRyZWVz aXQtbmV4dC1zaWJsaW5nLWRlZnVuKQogIChzaC1tb2RlLS10cmVlc2l0LXByZXYtc2libGluZy1k ZWZ1bik6IE5ldyBmdW5jdGlvbnMuC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hlIG5leHQgc2libGluZyBmdW5jdGlvbiBvZiBOT0RFLCBpZiBhbnksIG9yIG5pbC4iCisgIChs ZXQgKChzaWJsaW5nIG5vZGUpKQorICAgICh3aGlsZSAoYW5kIHNpYmxpbmcKKyAgICAgICAgICAg ICAgICAobm90IChzaC1tb2RlLS10cmVlc2l0LWRlZnVuLXAgc2libGluZykpKQorICAgICAgKHNl dHEgc2libGluZyAodHJlZXNpdC1ub2RlLW5leHQtc2libGluZyBzaWJsaW5nKSkpCisgICAgc2li bGluZykpCisKKyhkZWZ1biBzaC1tb2RlLS10cmVlc2l0LXByZXYtc2libGluZy1kZWZ1biAobm9k ZSkKKyAgIlJldHVybnMgdGhlIHByZXZpb3VzIHNpYmxpbmcgZnVuY3Rpb24gb2YgTk9ERSwgaWYg YW55LCBvciBuaWwuIgorICAobGV0ICgoc2libGluZyAodHJlZXNpdC1ub2RlLXByZXYtc2libGlu ZyBub2RlKSkpCisgICAgKHdoaWxlIChhbmQgc2libGluZworICAgICAgICAgICAgICAgIChub3Qg KHNoLW1vZGUtLXRyZWVzaXQtZGVmdW4tcCBzaWJsaW5nKSkpCisgICAgICAoc2V0cSBzaWJsaW5n ICh0cmVlc2l0LW5vZGUtcHJldi1zaWJsaW5nIHNpYmxpbmcpKSkKKyAgICBzaWJsaW5nKSkKKwor KGRlZm1hY3JvIHNoLW1vZGUtLXRyZWVzaXQtcGFyZW50LWRlZnVuIChub2RlKQorICAiUmV0dXJu cyBuZWFyZXN0IGZ1bmN0aW9uLW5vZGUgdGhhdCBzdXJyb3VuZHMgTk9ERSwgaWYgYW55LCBvciBu aWwuCisKK1RoaXMgbWFjcm8gY2FuIGJlIHVzZWQgdG8gZGV0ZXJtaW5lIGlmIE5PREUgaXMgd2l0 aGluIGEgZnVuY3Rpb24uICBJZgorc28sIHRoZSBtYWNybyBldmFsdWF0ZXMgdG8gdGhlIG5lYXJl c3QgZnVuY3Rpb24tbm9kZSBhbmQgcGFyZW50IG9mIE5PREUuCitPdGh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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlv bgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdCkpCisgICAgICAgICAgICAgIChzZXRxIHRhcmdldCAob3IgKHRyZWVzaXQtbm9kZS10b3At bGV2ZWwgbWF5YmUtdGFyZ2V0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heWJl LXRhcmdldCkpKSkKKyAgICAgICAgICAod2hlbiB0YXJnZXQKKyAgICAgICAgICAgIChzZXRxIGN1 cnIgdGFyZ2V0KSkKKyAgICAgICAgICAoc2V0cSBhcmcgKDEtIGFyZykpKQorICAgICAgOzsgR28g Zm9yd2FyZC4KKyAgICAgICh3aGlsZSAoYW5kICg8IGFyZyAwKSBjdXJyKQorICAgICAgICAoc2V0 cSB0YXJnZXQgbmlsKQorICAgICAgICAoaWYgKHNoLW1vZGUtLXRyZWVzaXQtZGVmdW4tcCBjdXJy KQorICAgICAgICAgICAgKHNldHEgY3VyciAodHJlZXNpdC1ub2RlLWF0CisgICAgICAgICAgICAg ICAgICAgICAgICAodHJlZXNpdC1ub2RlLWVuZAorICAgICAgICAgICAgICAgICAgICAgICAgICh0 cmVlc2l0LW5vZGUtcGFyZW50IGN1cnIpKSkpKQorICAgICAgICAobGV0ICgocGFyZW50LWRlZnVu IChzaC1tb2RlLS10cmVlc2l0LXBhcmVudC1kZWZ1biBjdXJyKSkpCisgICAgICAgICAgKHdoaWxl IChhbmQgKG5vdCB0YXJnZXQpCisgICAgICAgICAgICAgICAgICAgICAgcGFyZW50LWRlZnVuKQor ICAgICAgICAgICAgKHNldHEgdGFyZ2V0IChzaC1tb2RlLS10cmVlc2l0LW5leHQtc2libGluZy1k ZWZ1biBjdXJyKSkKKyAgICAgICAgICAgICh1bmxlc3MgdGFyZ2V0CisgICAgICAgICAgICAgIChz ZXRxIGN1cnIgKHRyZWVzaXQtbm9kZS1uZXh0LXNpYmxpbmcgcGFyZW50LWRlZnVuKSkKKyAgICAg ICAgICAgICAgKHNldHEgcGFyZW50LWRlZnVuCisgICAgICAgICAgICAgICAgICAgIChzaC1tb2Rl LS10cmVlc2l0LXBhcmVudC1kZWZ1biBjdXJyKSkpKQorICAgICAgICAgICh1bmxlc3MgdGFyZ2V0 CisgICAgICAgICAgICAobGV0ICgobWF5YmUtdGFyZ2V0IG5pbCkpCisgICAgICAgICAgICAgIChz ZXRxIG1heWJlLXRhcmdldCAodHJlZXNpdC1zZWFyY2gtZm9yd2FyZCBjdXJyCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbikp CisgICAgICAgICAgICAgIChzZXRxIHRhcmdldCAob3IgKHRyZWVzaXQtbm9kZS10b3AtbGV2ZWwg bWF5YmUtdGFyZ2V0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heWJlLXRhcmdl dCkpKSkKKyAgICAgICAgICAod2hlbiB0YXJnZXQKKyAgICAgICAgICAgIChzZXRxIGN1cnIgdGFy Z2V0KSkpCisgICAgICAgIChzZXRxIGFyZyAoMSsgYXJnKSkpKQorICAgICh3aGVuIHRhcmdldAor ICAgICAgKGdvdG8tY2hhciAodHJlZXNpdC1ub2RlLXN0YXJ0IHRhcmdldCkpKSkpCisKKyhkZWZ1 biBzaC1tb2RlLS10cmVlc2l0LWVuZC1vZi1kZWZ1bi1mdW5jdGlvbiAoKQorICAiVHJlZS1zaXR0 ZXIgYGVuZC1vZi1kZWZ1bi1mdW5jdGlvbicgZnVuY3Rpb24uIgorICAobGV0ICgoY3VyciAodHJl ZXNpdC1ub2RlLWF0IChwb2ludCkpKSkKKyAgICAoaWYgY3VycgorICAgICAgICAobGV0ICgoY3Vy ci1kZWZ1biAoc2gtbW9kZS0tdHJlZXNpdC1wYXJlbnQtZGVmdW4gY3VycikpKQorICAgICAgICAg IChpZiBjdXJyLWRlZnVuCisgICAgICAgICAgICAgIChnb3R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pbCkKKyAgICAgICAgKGZ1bmN0aW9uIHRyZWVz aXQtZGVmdW4tdHlwZS1yZWdleHApKQorICAgIChpZiAoPiBhcmcgMCkKKyAgICAgICAgOzsgR28g Zm9yd2FyZC4KKyAgICAgICAgKHdoaWxlIChhbmQgKD4gYXJnIDApIGN1cnIpCisgICAgICAgICAg KHNldHEgdGFyZ2V0IChzaC1tb2RlLS10cmVlc2l0LXBhcmVudC1kZWZ1biBjdXJyKSkKKyAgICAg ICAgICAodW5sZXNzIHRhcmdldAorICAgICAgICAgICAgKHNldHEgdGFyZ2V0ICh0cmVlc2l0LXNl YXJjaC1mb3J3YXJkIGN1cnIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBmdW5jdGlvbikpCisgICAgICAgICAgICAod2hlbiAoYW5kIHRhcmdldAorICAg ICAgICAgICAgICAgICAgICAgICAoc2gtbW9kZS0tdHJlZXNpdC1wYXJlbnQtZGVmdW4gdGFyZ2V0 KSkKKyAgICAgICAgICAgICAgKHNldHEgdGFyZ2V0ICh0cmVlc2l0LW5vZGUtdG9wLWxldmVsIHRh cmdldCkpKSkKKyAgICAgICAgICAod2hlbiB0YXJnZXQKKyAgICAgICAgICAgIChzZXRxIGN1cnIg dGFyZ2V0KSkKKyAgICAgICAgICAoc2V0cSBhcmcgKDEtIGFyZykpKQorICAgICAgOzsgR28gYmFj a3dhcmQuCisgICAgICAod2hpbGUgKGFuZCAoPCBhcmcgMCkgY3VycikKKyAgICAgICAgKHNldHEg dGFyZ2V0IG5pbCkKKyAgICAgICAgKGlmIChzaC1tb2RlLS10cmVlc2l0LXBhcmVudC1kZWZ1biBj dXJyKQorICAgICAgICAgICAgKHNldHEgY3VycgorICAgICAgICAgICAgICAgICAgKG9yIChzaC1t b2RlLS10cmVlc2l0LW9sZGVzdC1wYXJlbnQtaW4tZGVmdW4gY3VycikKKyAgICAgICAgICAgICAg ICAgICAgICBjdXJyKSkpCisgICAgICAgIChsZXQqICgocHJldi1kZWZ1biAoc2gtbW9kZS0tdHJl ZXNpdC1wcmV2LXNpYmxpbmctZGVmdW4gY3VycikpCisgICAgICAgICAgICAgICAocHJldi1kZWZ1 bi1lbmQgKHRyZWVzaXQtbm9kZS1hdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo dHJlZXNpdC1ub2RlLWVuZCBwcmV2LWRlZnVuKSkpKQorICAgICAgICAgIChpZiAoYW5kIHByZXYt ZGVmdW4gKHRyZWVzaXQtbm9kZS1lcSBjdXJyIHByZXYtZGVmdW4tZW5kKSkKKyAgICAgICAgICAg ICAgKHNldHEgY3VyciBwcmV2LWRlZnVuKSkpCisgICAgICAgIChsZXQgKChwYXJlbnQtZGVmdW4g KHNoLW1vZGUtLXRyZWVzaXQtcGFyZW50LWRlZnVuIGN1cnIpKSkKKyAgICAgICAgICAod2hpbGUg KGFuZCAobm90IHRhcmdldCkKKyAgICAgICAgICAgICAgICAgICAgICBwYXJlbnQtZGVmdW4pCisg ICAgICAgICAgICAoc2V0cSB0YXJnZXQgKHNoLW1vZGUtLXRyZWVzaXQtcHJldi1zaWJsaW5nLWRl ZnVuIGN1cnIpKQorICAgICAgICAgICAgKHVubGVzcyB0YXJnZXQKKyAgICAgICAgICAgICAgKHNl dHEgY3VyciAodHJlZXNpdC1ub2RlLXByZXYtc2libGluZyBwYXJlbnQtZGVmdW4pKQorICAgICAg ICAgICAgICAoc2V0cSBwYXJlbnQtZGVmdW4KKyAgICAgICAgICAgICAgICAgICAgKHNoLW1vZGUt LXRyZWVzaXQtcGFyZW50LWRlZnVuIGN1cnIpKSkpCisgICAgICAgICAgKHVubGVzcyB0YXJnZXQK KyAgICAgICAgICAgIChsZXQgKChtYXliZS10YXJnZXQgbmlsKSkKKyAgICAgICAgICAgICAgKHNl dHEgbWF5YmUtdGFyZ2V0ICh0cmVlc2l0LXNlYXJjaC1mb3J3YXJkIGN1cnIKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0 KSkKKyAgICAgICAgICAgICAgKHNldHEgdGFyZ2V0IChvciAodHJlZXNpdC1ub2RlLXRvcC1sZXZl bCBtYXliZS10YXJnZXQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF5YmUtdGFy Z2V0KSkpKQorICAgICAgICAgICh3aGVuIHRhcmdldAorICAgICAgICAgICAgKHNldHEgY3VyciB0 YXJnZXQpKSkKKyAgICAgICAgKHNldHEgYXJnICgxKyBhcmcpKSkpCisgICAgKHdoZW4gdGFyZ2V0 CisgICAgICAoZ290by1jaGFyICh0cmVlc2l0LW5vZGUtZW5kIHRhcmdldCkpKSkpCisKIChwcm92 aWRlICdzaC1zY3JpcHQpCiA7Ozsgc2gtc2NyaXB0LmVsIGVuZHMgaGVyZQotLSAKMi4zMS4xCgo= --000000000000b7d3f805ef329d58--