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: Wed, 7 Dec 2022 10:20:57 -0700 Message-ID: References: <1B9F9B3A-A757-4A65-9653-CD0112EB8895@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000074c43a05ef4025d2" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4629"; 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 18:22:14 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 1p2y7a-0000z1-4H for ged-emacs-devel@m.gmane-mx.org; Wed, 07 Dec 2022 18:22:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2y6e-0007qn-UT; Wed, 07 Dec 2022 12:21:16 -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 1p2y6c-0007oi-EE for emacs-devel@gnu.org; Wed, 07 Dec 2022 12:21:15 -0500 Original-Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p2y6Z-0002f1-0V for emacs-devel@gnu.org; Wed, 07 Dec 2022 12:21:13 -0500 Original-Received: by mail-ej1-x62d.google.com with SMTP id n21so15564464ejb.9 for ; Wed, 07 Dec 2022 09:21:10 -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=jV9BbGIYTH61XWJmkf9EggW38p3fEUTpvfq0iPviYvI=; b=etBmulA9OuqPh79iIwxZdjW4DN2rYR1jfNG/MtSMjCT6CXSQ1CRSy9VZeVLENOfswc rSmSHQH4x4jgmMxbnh4UVav9F/3i38yEHdVE+7z7V18zabzsc+gJmOdWR7QfwHjevvma e7GfnLEEaiC2Lli4jkSrU4EsytXw3uZaUgc4yMDIidGBJD0/yFezzI8au8/ApgJuo/CJ kfSp7ycv792V4D5wYkWHRVPETqpIxS6hZVoJxQXjokC0hOpHTCMBnIA9yIOTAVMZlbvM oXF71OYqFe/ukbcbQqHJkBznVzH0Z4AsuShtZLSBD6mlg8qk+Qr/t0nMKJ9ZWuNpkUeg z6bw== 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=jV9BbGIYTH61XWJmkf9EggW38p3fEUTpvfq0iPviYvI=; b=QWImdQsezYwPoFz1hPENxxrWq4f2MOq4RJc+s77B7ZrA8nUbidvHWcH+YuZgDa46La K0QPwu+BESX3OtXRJyoR9Dq7cRjN5aS0Wx9zKJQTHJb3H0FOF9SRQMvghdlwF4+9OJs8 d+1CyquQ2e3g9yWE8cBJ7JrlTh8vZ/J/E1jqMCOb+fwSGXTbfBaDB3pKaYI2t41BjAic UQhgpAvQLcV9fB6cTqMxVwJq6fIZp/UXTs7C1texX9xqgaNJksfrG7bY8MKDyXiFSRsp ZyaH6+ODiXbUcMoeCgGgdx68kqQM/lxPRoOFYbInS8YOqs2gZ9Zw6OONIut3nloDyp4c Lhxg== X-Gm-Message-State: ANoB5pmg1tmXBwUjHEN1bbCq0MsT7wTSVPDPyTjXE2Z/WiVFcSnWYlHA 8u5zzrP8vqwMzISvCdk7IEng0VBIL2IbAkgdORU= X-Google-Smtp-Source: AA0mqf5ayVFFy773fTWcgIM7W0ngXujz9yuAZf+EwVNnmemoJ8VWJsvmHNzKQcRvlkdmb54wbbRgN9ok/6y6AvVAVIo= X-Received: by 2002:a17:906:43d8:b0:7bd:7455:a196 with SMTP id j24-20020a17090643d800b007bd7455a196mr44928628ejn.71.1670433668902; Wed, 07 Dec 2022 09:21:08 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=jaopaulolc@gmail.com; helo=mail-ej1-x62d.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:301018 Archived-At: --00000000000074c43a05ef4025d2 Content-Type: multipart/alternative; boundary="00000000000074c43905ef4025d0" --00000000000074c43905ef4025d0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I found some minor issues and misspellings on the docstring. Here is an updated version of the patch. On Tue, Dec 6, 2022 at 6:12 PM Jo=C3=A3o Paulo Labegalini de Carvalho < jaopaulolc@gmail.com> wrote: > > > 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) th= e >> > closest sibling function (after point) and >> > `sh-mode--treesit-end-of-defun' moves >> > point to (end of) the closest sibling function (before point). In thi= s >> > 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. > > -- > Jo=C3=A3o Paulo L. de Carvalho > Ph.D Computer Science | IC-UNICAMP | Campinas , SP - Brazil > Postdoctoral Research Fellow | University of Alberta | Edmonton, AB - > Canada > joao.carvalho@ic.unicamp.br > joao.carvalho@ualberta.ca > --=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 --00000000000074c43905ef4025d0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I found some minor issues and misspellings on the docstrin= g.

Here is an updated version of the patch.

On Tue, Dec 6, 2022 at 6:= 12 PM Jo=C3=A3o Paulo Labegalini de Carvalho <jaopaulolc@gmail.com> wrote:


On = Tue, Dec 6, 2022 at 4:50 PM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> However, wit= h 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. d= e Carvalho
Ph.D Computer Science | =C2=A0IC-UNICAMP | Campinas , SP - Br= azil
Postdoctoral Research Fellow | University of Alberta | Edmonton, AB= - Canada


--
Jo= =C3=A3o Paulo L. de Carvalho
Ph.D Computer Science | =C2=A0IC-UNICAMP | = Campinas , SP - Brazil
Postdoctoral Research Fellow | University of Albe= rta | Edmonton, AB - Canada
--00000000000074c43905ef4025d0-- --00000000000074c43a05ef4025d2 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_lbdx2gh60 RnJvbSAwYjg5MzEzNTY1NWRhMjJiOTQ0ZDA5MGU4Y2NhYjMxNDc2ZWFhOWE4IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/Sm89QzM9QTNvPTIwUD0yRT0yMEw9MkU9MjBk ZT0yMENhcnZhbGhvPz0KIDxqYW9wYXVsb2xjQGdtYWlsLmNvbT4KRGF0ZTogU2F0LCAzIERlYyAy MDIyIDEyOjU1OjI3IC0wNzAwClN1YmplY3Q6IFtQQVRDSF0gQmFzaWMgbmF2aWdhdGlvbiBmb3Ig YmFzaC10cy1tb2RlCgpFbmFibGVzIG5hdmlnYXRpb24gdG8gYmVnaW5uaW5nL2VuZCBvZiBmdW5j dGlvbiBpbiBiYXNoLXRzLW1vZGUuCiAgKiBsaXNwL3Byb2dtb2Rlcy9zaC1zY3JpcHQuZWwgKGJh c2g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yd2lzZS4iCisgIChzdHJpbmctbWF0Y2ggdHJlZXNpdC1kZWZ1bi10eXBl LXJlZ2V4cAorICAgICAgICAgICAgICAgICh0cmVlc2l0LW5vZGUtdHlwZSBub2RlKSkpCisKKyhk ZWZ1biBzaC1tb2RlLXRyZWVzaXQtbm90LWNzLXAgKG5vZGUpCisgICJSZXR1cm4gdCBpZiBOT0RF IGlzICpub3QqIGEgY29tcG91bmQtc3RhdGVtZW50IGFuZCBuaWwgb3RoZXJ3aXNlLiIKKyAgKGxh bWJkYSAocCkKKyAgICAobm90IChzdHJpbmctbWF0Y2ggImNvbXBvdW5kX3N0YXRlbWVudCIKKyAg ICAgICAgICAgICAgICAgICAgICAgKHRyZWVzaXQtbm9kZS10eXBlIHApKSkpKQorCisoZGVmdW4g c2gtbW9kZS0tdHJlZXNpdC1uZXh0LXNpYmxpbmctZGVmdW4gKG5vZGUpCisgICJSZXR1cm4gdGhl IG5leHQgc2libGluZyBmdW5jdGlvbiBvZiBOT0RFLCBpZiBhbnksIG9yIG5pbC4iCisgIChsZXQg KChzaWJsaW5nIG5vZGUpKQorICAgICh3aGlsZSAoYW5kIHNpYmxpbmcKKyAgICAgICAgICAgICAg ICAobm90IChzaC1tb2RlLS10cmVlc2l0LWRlZnVuLXAgc2libGluZykpKQorICAgICAgKHNldHEg c2libGluZyAodHJlZXNpdC1ub2RlLW5leHQtc2libGluZyBzaWJsaW5nKSkpCisgICAgc2libGlu ZykpCisKKyhkZWZ1biBzaC1tb2RlLS10cmVlc2l0LXByZXYtc2libGluZy1kZWZ1biAobm9kZSkK KyAgIlJldHVybiB0aGUgcHJldmlvdXMgc2libGluZyBmdW5jdGlvbiBvZiBOT0RFLCBpZiBhbnks IG9yIG5pbC4iCisgIChsZXQgKChzaWJsaW5nICh0cmVlc2l0LW5vZGUtcHJldi1zaWJsaW5nIG5v ZGUpKSkKKyAgICAod2hpbGUgKGFuZCBzaWJsaW5nCisgICAgICAgICAgICAgICAgKG5vdCAoc2gt bW9k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NpdC1ub2RlLWF0IChwb2ludCkpKQorICAgICAgICAoZnVuY3Rpb24gdHJlZXNpdC1k ZWZ1bi10eXBlLXJlZ2V4cCkpCisgICAgKGlmICg+IGFyZyAwKQorICAgICAgICA7OyBHbyBiYWNr d2FyZC4KKyAgICAgICAgKHdoaWxlIChhbmQgKD4gYXJnIDApIGN1cnIpCisgICAgICAgICAgKGlm IChzdHJpbmc9ICh0cmVlc2l0LW5vZGUtdHlwZSBjdXJyKSAiZnVuY3Rpb24iKQorICAgICAgICAg ICAgICAoc2V0cSBjdXJyICh0cmVlc2l0LW5vZGUtcGFyZW50IGN1cnIpKSkKKyAgICAgICAgICAo c2V0cSB0YXJnZXQgKHNoLW1vZGUtLXRyZWVzaXQtcGFyZW50LWRlZnVuIGN1cnIpKQorICAgICAg ICAgICh1bmxlc3MgdGFyZ2V0CisgICAgICAgICAgICAobGV0ICgobWF5YmUtdGFyZ2V0IG5pbCkp CisgICAgICAgICAgICAgIChzZXRxIG1heWJlLXRhcmdldCAodHJlZXNpdC1zZWFyY2gtZm9yd2Fy ZCBjdXJyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBmdW5jdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgdCkpCisgICAgICAgICAgICAgIChzZXRxIHRhcmdldCAob3IgKHRy ZWVzaXQtbm9kZS10b3AtbGV2ZWwgbWF5YmUtdGFyZ2V0KQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG1heWJlLXRhcmdldCkpKSkKKyAgICAgICAgICAod2hlbiB0YXJnZXQKKyAgICAg ICAgICAgIChzZXRxIGN1cnIgdGFyZ2V0KSkKKyAgICAgICAgICAoc2V0cSBhcmcgKDEtIGFyZykp KQorICAgICAgOzsgR28gZm9yd2FyZC4KKyAgICAgICh3aGlsZSAoYW5kICg8IGFyZyAwKSBjdXJy KQorICAgICAgICAoc2V0cSB0YXJnZXQgbmlsKQorICAgICAgICAoaWYgKHNoLW1vZGUtLXRyZWVz aXQtZGVmdW4tcCBjdXJyKQorICAgICAgICAgICAgKHNldHEgY3VyciAodHJlZXNpdC1ub2RlLWF0 CisgICAgICAgICAgICAgICAgICAgICAgICAodHJlZXNpdC1ub2RlLWVuZAorICAgICAgICAgICAg ICAgICAgICAgICAgICh0cmVlc2l0LW5vZGUtcGFyZW50IGN1cnIpKSkpKQorICAgICAgICAobGV0 ICgocGFyZW50LWRlZnVuIChzaC1tb2RlLS10cmVlc2l0LXBhcmVudC1kZWZ1biBjdXJyKSkpCisg ICAgICAgICAgKHdoaWxlIChhbmQgKG5vdCB0YXJnZXQpCisgICAgICAgICAgICAgICAgICAgICAg cGFyZW50LWRlZnVuKQorICAgICAgICAgICAgKHNldHEgdGFyZ2V0IChzaC1tb2RlLS10cmVlc2l0 LW5leHQtc2libGluZy1kZWZ1biBjdXJyKSkKKyAgICAgICAgICAgICh1bmxlc3MgdGFyZ2V0Cisg ICAgICAgICAgICAgIChzZXRxIGN1cnIgKHRyZWVzaXQtbm9kZS1uZXh0LXNpYmxpbmcgcGFyZW50 LWRlZnVuKSkKKyAgICAgICAgICAgICAgKHNldHEgcGFyZW50LWRlZnVuCisgICAgICAgICAgICAg ICAgICAgIChzaC1tb2RlLS10cmVlc2l0LXBhcmVudC1kZWZ1biBjdXJyKSkpKQorICAgICAgICAg ICh1bmxlc3MgdGFyZ2V0CisgICAgICAgICAgICAobGV0ICgobWF5YmUtdGFyZ2V0IG5pbCkpCisg ICAgICAgICAgICAgIChzZXRxIG1heWJlLXRhcmdldCAodHJlZXNpdC1zZWFyY2gtZm9yd2FyZCBj dXJyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBmdW5jdGlvbikpCisgICAgICAgICAgICAgIChzZXRxIHRhcmdldCAob3IgKHRyZWVzaXQt bm9kZS10b3AtbGV2ZWwgbWF5YmUtdGFy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KGFuZCB0YXJnZXQKKyAgICAgICAgICAgICAgICAgICAgICAgKHNoLW1vZGUtLXRyZWVz aXQtcGFyZW50LWRlZnVuIHRhcmdldCkpCisgICAgICAgICAgICAgIChzZXRxIHRhcmdldCAodHJl ZXNpdC1ub2RlLXRvcC1sZXZlbCB0YXJnZXQpKSkpCisgICAgICAgICAgKHdoZW4gdGFyZ2V0Cisg ICAgICAgICAgICAoc2V0cSBjdXJyIHRhcmdldCkpCisgICAgICAgICAgKHNldHEgYXJnICgxLSBh cmcpKSkKKyAgICAgIDs7IEdvIGJhY2t3YXJkLgorICAgICAgKHdoaWxlIChhbmQgKDwgYXJnIDAp IGN1cnIpCisgICAgICAgIChzZXRxIHRhcmdldCBuaWwpCisgICAgICAgIChpZiAoc2gtbW9kZS0t dHJlZXNpdC1wYXJlbnQtZGVmdW4gY3VycikKKyAgICAgICAgICAgIChzZXRxIGN1cnIKKyAgICAg ICAgICAgICAgICAgIChvciAoc2gtbW9kZS0tdHJlZXNpdC1vbGRlc3QtcGFyZW50LWluLWRlZnVu IGN1cnIpCisgICAgICAgICAgICAgICAgICAgICAgY3VycikpKQorICAgICAgICAobGV0KiAoKHBy ZXYtZGVmdW4gKHNoLW1vZGUtLXRyZWVzaXQtcHJldi1zaWJsaW5nLWRlZnVuIGN1cnIpKQorICAg ICAgICAgICAgICAgKHByZXYtZGVmdW4tZW5kICh0cmVlc2l0LW5vZGUtYXQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKHRyZWVzaXQtbm9kZS1lbmQgcHJldi1kZWZ1bikpKSkKKyAg ICAgICAgICAoaWYgKGFuZCBwcmV2LWRlZnVuICh0cmVlc2l0LW5vZGUtZXEgY3VyciBwcmV2LWRl ZnVuLWVuZCkpCisgICAgICAgICAgICAgIChzZXRxIGN1cnIgcHJldi1kZWZ1bikpKQorICAgICAg ICAobGV0ICgocGFyZW50LWRlZnVuIChzaC1tb2RlLS10cmVlc2l0LXBhcmVudC1kZWZ1biBjdXJy KSkpCisgICAgICAgICAgKHdoaWxlIChhbmQgKG5vdCB0YXJnZXQpCisgICAgICAgICAgICAgICAg ICAgICAgcGFyZW50LWRlZnVuKQorICAgICAgICAgICAgKHNldHEgdGFyZ2V0IChzaC1tb2RlLS10 cmVlc2l0LXByZXYtc2libGluZy1kZWZ1biBjdXJyKSkKKyAgICAgICAgICAgICh1bmxlc3MgdGFy Z2V0CisgICAgICAgICAgICAgIChzZXRxIGN1cnIgKHRyZWVzaXQtbm9kZS1wcmV2LXNpYmxpbmcg cGFyZW50LWRlZnVuKSkKKyAgICAgICAgICAgICAgKHNldHEgcGFyZW50LWRlZnVuCisgICAgICAg ICAgICAgICAgICAgIChzaC1tb2RlLS10cmVlc2l0LXBhcmVudC1kZWZ1biBjdXJyKSkpKQorICAg ICAgICAgICh1bmxlc3MgdGFyZ2V0CisgICAgICAgICAgICAobGV0ICgobWF5YmUtdGFyZ2V0IG5p bCkpCisgICAgICAgICAgICAgIChzZXRxIG1heWJlLXRhcmdldCAodHJlZXNpdC1zZWFyY2gtZm9y d2FyZCBjdXJyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBmdW5jdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgdCkpCisgICAgICAgICAgICAgIChzZXRxIHRhcmdldCAob3Ig KHRyZWVzaXQtbm9kZS10b3AtbGV2ZWwgbWF5YmUtdGFyZ2V0KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIG1heWJlLXRhcmdldCkpKSkKKyAgICAgICAgICAod2hlbiB0YXJnZXQKKyAg ICAgICAgICAgIChzZXRxIGN1cnIgdGFyZ2V0KSkpCisgICAgICAgIChzZXRxIGFyZyAoMSsgYXJn KSkpKQorICAgICh3aGVuIHRhcmdldAorICAgICAgKGdvdG8tY2hhciAodHJlZXNpdC1ub2RlLWVu ZCB0YXJnZXQpKSkpKQorCiAocHJvdmlkZSAnc2gtc2NyaXB0KQogOzs7IHNoLXNjcmlwdC5lbCBl bmRzIGhlcmUKLS0gCjIuMzEuMQoK --00000000000074c43a05ef4025d2--