From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 27 11:32:00 2022 Received: (at submit) by debbugs.gnu.org; 27 Nov 2022 16:32:00 +0000 Received: from localhost ([127.0.0.1]:42964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozKZT-0006SH-TN for submit@debbugs.gnu.org; Sun, 27 Nov 2022 11:32:00 -0500 Received: from lists.gnu.org ([209.51.188.17]:36226) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozKZS-0006SB-MY for submit@debbugs.gnu.org; Sun, 27 Nov 2022 11:31:59 -0500 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 1ozKZR-0004mG-Lc for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 11:31:58 -0500 Received: from kamnitnik.top ([2001:19f0:5001:bf2:5400:2ff:fee0:2626]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozKZP-0001aF-OX for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 11:31:57 -0500 From: miha@kamnitnik.top DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1669566711; bh=myy+EahM/VIVxUuuP2CgBNUV3WFFQzMHwrz76kYMvNQ=; h=From:To:Subject:Date:From; b=i8Z8k0x+dDEjieh4TirsoUsfayznl+O0CNawiBTlAXSjYppAoq36FgRCnXY90saj6 325QGvmacibNPu9kik1Jqgib3jPtyh3/KJ6c4QofQ9FWKBVOTt04a2MRtjnJpKUWzt pkCRtN+KY6DlT02aKgJUxcmtxBg+iStxOGj87UlzWtTawQxuiyhj2uRRJ9arlDQOLX ew0VdxTMfbZH+8zqOfLEfiihoLINGF6YqkE0yJUkz2Kaq8G/Bj7d3NkBeZBUuLOtqd iQOm1aaA/xBnRaSnmHVuv52uwT8r3i5fMGff+PiiK3+mZ947BBVDAbTbW8ouZQdQCM 5nVIKoHoTN2Qg== To: bug-gnu-emacs@gnu.org Subject: 29.0.50; tree-sitter-bash: Incorrect behaviour of heredocs with expansions Date: Sun, 27 Nov 2022 17:33:11 +0100 Message-ID: <871qpocq7s.fsf@miha-pc> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=2001:19f0:5001:bf2:5400:2ff:fee0:2626; envelope-from=miha@kamnitnik.top; helo=kamnitnik.top X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 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, FROM_SUSPICIOUS_NTLD=0.001, FROM_SUSPICIOUS_NTLD_FP=0.695, PDS_OTHER_BAD_TLD=1.999, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 2.6 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 1. Visit empty buffer test in fundamental mode (C-x b test RET) 2. Insert tee << EOF text1 $var text2 $(echo cmd) text3 $var2 EOF 3. Put point before "text2" 4. M-x load-library RET treesit RET 5. M-: (treesit-node-children (treesit-node-at (point) 'bash)) Content analysis details: (2.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.9 SPF_FAIL SPF: sender does not match SPF record (fail) [SPF failed: Please see http://www.openspf.org/Why?s=mfrom; id=miha%40kamnitnik.top; ip=209.51.188.17; r=debbugs.gnu.org] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.51.188.17 listed in wl.mailspike.net] 2.0 FROM_SUSPICIOUS_NTLD_FP From abused NTLD 0.0 FROM_SUSPICIOUS_NTLD From abused NTLD X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) --=-=-= Content-Type: text/plain 1. Visit empty buffer test in fundamental mode (C-x b test RET) 2. Insert tee << EOF text1 $var text2 $(echo cmd) text3 $var2 EOF 3. Put point before "text2" 4. M-x load-library RET treesit RET 5. M-: (treesit-node-children (treesit-node-at (point) 'bash)) => (# #) Note that this list is incorrect, "$var2" at the end of heredoc is missing. 6. M-: (treesit-node-first-child-for-pos (treesit-node-at (point) 'bash) (point)) => nil Expected return value here is # I'm not sure if this bug is on Emacs, tree-sitter-bash or even tree-sitter itself and I don't know how to check. tree-sitter-bash version: 0.19.0.r19.g77cf8a7-1 tree-sitter version: 0.20.7-1 Thanks and best regards. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmODkUcTHG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZP0RLD/9VbZlWr7J2slHBrD3p6xMxSDpDjsaE jro1PGHsSkpgNAfDGoVxDBI9fiaen3/UVGgC95gQ6I/le3ChBB3V2Y8/opFIIY9Y uthQZRVOb1IA/9Sf4UERRW/G29ygUz6AyNmGyRUOk5kBiFHkiC4xBjlKMnIqcGoV HoJedWG5DOcAaly9ifCA8AWz2+pRe3GP941Jnhw/t8Do/UawzzcOB4+NNcop+vnE c8NVN69LmeEi6zBAmHM9gPfDnPK4RrEpzkATDlyjXnitB1G76bwAFOZVszpwNByp ehlKb/RUhl7cRWINc3Oyvw1iab/e6Mfay4WdF46gEzy/YSlA4y7aEx4EA7K4muCI JCBP1HGauUlpgcBZBtqi15MYISDD8OfvirNZIWBxQ+/L4LoqPQoujgm2BO0BQS9H y00kiZAiTd32FYHG/9P4B4pfrrY2GPGVFBuc6ne4SwryxrQPrXbdwaO5gf7PA/Uz coVcwFAHA5kEqFLi5/RXqiJBlS1HIEsLACVTiE8i2sD0DWYksMO/9jehbWvoTHU9 ShqRybrKo23FLbOr3aZRNaSs1IpBgAOukgn45g6Ddom3KAf3GamOvhn7fSEMbMGz RsQPbvQvDeZMr63r3zVGivE97k9D7CanhV4iqsG7/XtFave2lWVLFhcoUAXKrx32 hj9dIKgxagO4Yg== =uc6n -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 00:25:37 2022 Received: (at 59633) by debbugs.gnu.org; 2 Dec 2022 05:25:37 +0000 Received: from localhost ([127.0.0.1]:44206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0yYL-0007fF-1L for submit@debbugs.gnu.org; Fri, 02 Dec 2022 00:25:37 -0500 Received: from mail-pj1-f51.google.com ([209.85.216.51]:41734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0yYI-0007f9-Lt for 59633@debbugs.gnu.org; Fri, 02 Dec 2022 00:25:35 -0500 Received: by mail-pj1-f51.google.com with SMTP id w15-20020a17090a380f00b0021873113cb4so4209476pjb.0 for <59633@debbugs.gnu.org>; Thu, 01 Dec 2022 21:25:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=pFYzJTVB/v/ZcTG3Q7MMsEA+WCfBPwDc2x004f//bkY=; b=PLjItMs43kI6Oxacb/K6O9WwpX2TCXaN1oB3thWw3J94MyLNDZ0hs4DRIM+jj+e2n/ OAe4rZIGis1oJTPTPsY7mW3OCOoth5Xk81/546QL8tF4H2i1vAsVRsyngbRdt07H+ktW mPbe7KYH6G4PN3PDv9tpZRIYGCeqfXUp71oZlGvNpqLixscl64IJ7Pi8/N8Df4CjCD1F yNOFxnRgdhFlGXKUJo/pnqqW6tNYzXAU+mXMmbt60YVomtZWX6YoKIDvXujtod8Hu5fx ABEYpSX0Zb40hbjz+mTKZKFEqprgbLDMN4feeJcqUqJFyixWG9+AHjP2TP8bZpe0AGGT WgnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pFYzJTVB/v/ZcTG3Q7MMsEA+WCfBPwDc2x004f//bkY=; b=NeqOf0kmzVY4+IO/miT/O6/KEKZY8evy/z892VjsFynbh3TjhwZjRVTK+lUygJbCXu 2BgCE2VmwV84hK6qY+NuY+KTOMPgOf0KX/wnronytjblKXGxvxnYhQrRBWK2andX4Owh oYG1oR4BfL2Tx5RvB9OytHN88rfoAeMHHrf3gJxD5VxJgSXJhtTS3rIRKYKBk3ejjhle tDLU4PXEWGm5kLt+v2FXBTf+gzMmEOgUVLJdRuaOcinkP7PJ+cZ+mXlqy5hIFZ+FxdIe aEjQaE6Xs+zABaXwNMqkeZ6x+N7hVNHBZ6mOTik2pe/NoWgUtIUBI05w6aeIuUoyDqKT l4rg== X-Gm-Message-State: ANoB5pk1lpJDFiiT++ihJXAnbcz6oZBbsfQ2GX0Jn6py9cJKpG40GG1a URpIeC9+cVyo4kCWJ7CXQAQA9SsTsslL0g== X-Google-Smtp-Source: AA0mqf6AOiFtC5XVQ6NDJeZK9KXYV2Is8yYvH9p/CqeAEIBFazupvLnjE/fJa2diFZd1F24Q6J9Pbw== X-Received: by 2002:a17:902:6b07:b0:189:93a5:bcc6 with SMTP id o7-20020a1709026b0700b0018993a5bcc6mr21182459plk.156.1669958728651; Thu, 01 Dec 2022 21:25:28 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id cp15-20020a170902e78f00b0018981daee22sm4579713plb.17.2022.12.01.21.25.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Dec 2022 21:25:28 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#59633: 29.0.50; tree-sitter-bash: Incorrect behaviour of heredocs with expansions Message-Id: <90FF5B60-A9AB-4101-9FE3-8FCAD8B9DCE8@gmail.com> Date: Thu, 1 Dec 2022 21:25:26 -0800 To: miha@kamnitnik.top X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > 1. Visit empty buffer test in fundamental mode (C-x b test RET) > 2. Insert > > tee << EOF > text1 $var > text2 $(echo cmd) > text3 > $var2 > EOF > > 3. Put point before "text2" > 4. M-x load-librar [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.216.51 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (casouri[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.216.51 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 59633 Cc: 59633@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) miha@kamnitnik.top writes: > 1. Visit empty buffer test in fundamental mode (C-x b test RET) > 2. Insert > > tee << EOF > text1 $var > text2 $(echo cmd) > text3 > $var2 > EOF > > 3. Put point before "text2" > 4. M-x load-library RET treesit RET > 5. M-: (treesit-node-children (treesit-node-at (point) 'bash)) > > =3D> (# > #) > > Note that this list is incorrect, "$var2" at the end of heredoc is > missing. > > 6. M-: (treesit-node-first-child-for-pos (treesit-node-at (point) = 'bash) (point)) > > =3D> nil > > Expected return value here is # > > I'm not sure if this bug is on Emacs, tree-sitter-bash or even > tree-sitter itself and I don't know how to check. > > tree-sitter-bash version: 0.19.0.r19.g77cf8a7-1 > tree-sitter version: 0.20.7-1 > > Thanks and best regards. Thanks. This is the tree produced by tree-sitter, does it match your expectation? (heredoc_body (simple_expansion $ (variable_name)) (command_substitution $( (command name: (command_name (word)) argument: (word)) )) (simple_expansion $ (variable_name))) treesit-node-at gives you the _smallest_ node at point, maybe that=E2=80=99= s why you didn=E2=80=99t see expected behavior? Yuan From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 11:25:02 2022 Received: (at 59633) by debbugs.gnu.org; 2 Dec 2022 16:25:02 +0000 Received: from localhost ([127.0.0.1]:47583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p18qT-00077b-Q3 for submit@debbugs.gnu.org; Fri, 02 Dec 2022 11:25:02 -0500 Received: from kamnitnik.top ([209.250.245.214]:42516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p18qQ-00077U-SC for 59633@debbugs.gnu.org; Fri, 02 Dec 2022 11:25:00 -0500 From: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1669998294; bh=8vRXZUZxzvfwcYTqXEcPG3S280yyGL+zPEhcUhfcrhw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=MclphUSr/72+1WMDkbXIAtl8GQwhKqz8SUy3/5siEac6UA/3qCmAMfyLGchXlbtNF O5W3KbED1pjjNFM1Tp92O+r36a+szPEZHpdKHFkMQ0s4Jk4pdAfHRTusHBWSeaN6o4 7ndHVfiHWXK//rut7tbCnJuszGx49ZJa9MvZdDZ8mVQ/ap+fCPPEwSOZf7iQAFwK97 y6dMAJNwk8gwdICt7BGR6gANUJfNRmkT1+pAqGkLsIzziSsjT7GgQYhZhubMUMDUTI 6Ix+HtqoXdVPNlklA3gHilurK1Bc1MhEN5ncS3pdkRFBa5N9RS5Kqy/t0h/sliQLpB DEeAWW7XnECQw== To: Yuan Fu Subject: Re: bug#59633: 29.0.50; tree-sitter-bash: Incorrect behaviour of heredocs with expansions In-Reply-To: <90FF5B60-A9AB-4101-9FE3-8FCAD8B9DCE8@gmail.com> References: <871qpocq7s.fsf@miha-pc> <90FF5B60-A9AB-4101-9FE3-8FCAD8B9DCE8@gmail.com> Date: Fri, 02 Dec 2022 17:26:23 +0100 Message-ID: <87o7slbwls.fsf@miha-pc> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Yuan Fu writes: > miha@kamnitnik.top writes: > >> 1. Visit empty buffer test in fundamental mode (C-x b test RET) >> 2. Insert >> >> tee << EOF >> text1 $var >> text2 $(echo cmd) >> text3 >> $var2 >> EOF >> >> 3. Put [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FROM_SUSPICIOUS_NTLD From abused NTLD X-Debbugs-Envelope-To: 59633 Cc: 59633@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Yuan Fu writes: > miha@kamnitnik.top writes: > >> 1. Visit empty buffer test in fundamental mode (C-x b test RET) >> 2. Insert >> >> tee << EOF >> text1 $var >> text2 $(echo cmd) >> text3 >> $var2 >> EOF >> >> 3. Put [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD 0.0 FROM_SUSPICIOUS_NTLD From abused NTLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Yuan Fu writes: > miha@kamnitnik.top writes: > >> 1. Visit empty buffer test in fundamental mode (C-x b test RET) >> 2. Insert >> >> tee << EOF >> text1 $var >> text2 $(echo cmd) >> text3 >> $var2 >> EOF >> >> 3. Put point before "text2" >> 4. M-x load-library RET treesit RET >> 5. M-: (treesit-node-children (treesit-node-at (point) 'bash)) >> >> =3D> (# >> #) >> >> Note that this list is incorrect, "$var2" at the end of heredoc is >> missing. >> >> 6. M-: (treesit-node-first-child-for-pos (treesit-node-at (point) 'bash)= (point)) >> >> =3D> nil >> >> Expected return value here is # >> >> I'm not sure if this bug is on Emacs, tree-sitter-bash or even >> tree-sitter itself and I don't know how to check. >> >> tree-sitter-bash version: 0.19.0.r19.g77cf8a7-1 >> tree-sitter version: 0.20.7-1 >> >> Thanks and best regards. > > Thanks. This is the tree produced by tree-sitter, does it match your > expectation? > > (heredoc_body > (simple_expansion $ (variable_name)) > (command_substitution $( > (command > name: (command_name (word)) > argument: (word)) > )) > (simple_expansion $ (variable_name))) > > treesit-node-at gives you the _smallest_ node at point, maybe that=E2=80= =99s why > you didn=E2=80=99t see expected behavior? > > Yuan The latest commit to tree-sitter-bash is commit 4488aa41406547e478636a4fcfd24f5bbc3f2f74 Author: Jo=C3=A3o P. L. Carvalho Date: Sun Nov 27 20:39:41 2022 -0700 Fix scanning of heredoc_body to allow empty bodies (#137). Seems like it has fixed the problem described in the 5. step and the tree produced by tree-sitter is now expected. The problem in the 6. step is still present though. With point in front of command_substitution, on would expect (treesit-node-first-child-for-pos (treesit-node-at (point) 'bash) (poin= t)) to return the command_substitution node instead of returning nil. Thanks. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmOKJy8THG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZP4PcD/43OLOVc/tYOFLLZALo5Cu22WPyXS7B btIXBmyZF3RxTfklQRzYujRlwEONxDm3FvuU7sFm9rK56ZB9SQ/gJ4GIr+akCKjC kD7CXnRdc1u9C88sS9bsbq/l/UQ+iJhXakoITH9FRfxe21oVWN9UFbsPxI1KG+sR h92lFYv5G6sZixBlw5PhOMOFVt7q3txmPGO8BUX2cKsRnXIIITb0LzO0PAa+MdjE hOQhp2MDyYLSULT+TsGA6HwbruAuwJ4zvbPxOU/v/B+RXVuRHoRKWyPGBFJWnoxF rOok1nzPCHPvYAAnwNoQmsKLJwXPSXBVVnBxCYngJTU/QoiSuxl0sHxnf558gkcT /6xav3G91D0/N18CEr2BWkbT4P9F60dF2WTQ2mecmCm5efDqy54F1B/+6vAnWI7k emQfoQweQaTt6LPzXzysgRThAbo5/uRSnZtJAOWgqytZCshHPckqvZLPmYetUNN5 Ev3BHpc4TSAr4GCffdbD4+2WdehWH7T4iZASR3e1Ktfh57KV5B0TD/HMivjOmrHz ET+hlHIOf9VotjeGIxFzn4Rx95V+kJgUlG4h/VRkbIxp1ZtlsqWewg2WJa0c+7OE V1XWNV05f3DkoHXkYlbkoHmmPMZuJtGNXlaeS09eGZ5qAApK9i97Id/d9INUA8XF DdfKWLwFy/KCXA== =um/T -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 19:50:31 2022 Received: (at 59633) by debbugs.gnu.org; 3 Dec 2022 00:50:31 +0000 Received: from localhost ([127.0.0.1]:49840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1Gjf-0005oy-2q for submit@debbugs.gnu.org; Fri, 02 Dec 2022 19:50:31 -0500 Received: from mail-pj1-f50.google.com ([209.85.216.50]:39545) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1Gjd-0005oq-7R for 59633@debbugs.gnu.org; Fri, 02 Dec 2022 19:50:30 -0500 Received: by mail-pj1-f50.google.com with SMTP id e7-20020a17090a77c700b00216928a3917so9793646pjs.4 for <59633@debbugs.gnu.org>; Fri, 02 Dec 2022 16:50:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=bNPR26nsxcsTl9oYYl3QtMp9f/X7174b5Cip8oMYAiw=; b=HM3d4EsKe3M2woV1WdvlDta95TBDBrs8fAt4g3xS+6pA7IocMWy17cDkaXZyjJ25oU ODxDP0idImJX3cSNEvhJgudzrXJmaX4ZtIKP6IoxW330hBQFmln0X5y0vZc1M+8J1qpN T5IAtEyl5+Ne0a5tZeaCZrid/Lqe6uaqt6kDrUq6msTpwB4WaFiLpCqbb1R2IR0SqlpQ wKZhHdADxdtxRHb6qoE6ptOQMxS3i1rvaZcnXJZ1NUezRwv8Hbhxj3LtM7U9UzSXct1U JK568jzLkdYkXXbZl6T+wtEkYbi6xu4KNl6AStDSiIHfPhB5MSWQdHwhlrVqorguvPOT yR+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bNPR26nsxcsTl9oYYl3QtMp9f/X7174b5Cip8oMYAiw=; b=dTSmES/nWx7F42Xbz2ZL1tizzCI0vvP3xoXB0Le+zXcwiW5sQ8oHqEGPfBolwCPcu9 9DIbx7lHlJKLp2LYoaHle/kn4lHLrTebWpNq13qUBCPJe8JD/IKUXxcxWxHsJ1jCeuib dDiA7V8f+qnKQ1UoxU3eqOvZDsiZnQ7dh5NrEQoxiLu3IXsnVKb+uuQfe7lALMAyKTLu 8oF+xRKdiPjB8aPe95DoD/5qSpQCzv/TbZlgnwj/zG+DClYzm5uLbnXPhX0vGgILvF0p lePvy/BBdaR7xkQMc2+rPY+kllfdMWuQzEjVE/EwzyxtvLalyoRJGcg3uNvkm4578t0J UrUg== X-Gm-Message-State: ANoB5pnpUPFzOt41RmIID8pn01x84089WSsiACPjiAlkr14hvDmr33Nh ORyC+W9KVKcGEQb0gI8Sxfg= X-Google-Smtp-Source: AA0mqf5gtPlzZeAq2RuTZJwHQrXkPwxFtd0rW+kqHVfBer8EhBwJiBI/1Jw12H064cV28HX7h85dHQ== X-Received: by 2002:a17:90a:460f:b0:218:c47f:ed9a with SMTP id w15-20020a17090a460f00b00218c47fed9amr58700014pjg.19.1670028622403; Fri, 02 Dec 2022 16:50:22 -0800 (PST) Received: from smtpclient.apple (108-241-83-33.lightspeed.irvnca.sbcglobal.net. [108.241.83.33]) by smtp.gmail.com with ESMTPSA id p3-20020a170902e74300b00189988a1a9esm6167976plf.135.2022.12.02.16.50.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Dec 2022 16:50:22 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#59633: 29.0.50; tree-sitter-bash: Incorrect behaviour of heredocs with expansions From: Yuan Fu In-Reply-To: <87o7slbwls.fsf@miha-pc> Date: Fri, 2 Dec 2022 16:50:20 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <6767DDE2-911D-487F-A4B6-13DE8A0D0915@gmail.com> References: <871qpocq7s.fsf@miha-pc> <90FF5B60-A9AB-4101-9FE3-8FCAD8B9DCE8@gmail.com> <87o7slbwls.fsf@miha-pc> To: miha@kamnitnik.top X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > On Dec 2, 2022, at 8:26 AM, > > Yuan Fu writes: > >> >> >>> 1. Visit empty buffer test in fundamental mode (C-x b test RET) >>> 2. Insert >>> >>> tee << EOF >>> text1 $var >>> text2 $(echo cmd [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.216.50 listed in list.dnswl.org] 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (casouri[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.216.50 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 59633 Cc: 59633@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > On Dec 2, 2022, at 8:26 AM, miha@kamnitnik.top wrote: >=20 > Yuan Fu writes: >=20 >> miha@kamnitnik.top writes: >>=20 >>> 1. Visit empty buffer test in fundamental mode (C-x b test RET) >>> 2. Insert >>>=20 >>> tee << EOF >>> text1 $var >>> text2 $(echo cmd) >>> text3 >>> $var2 >>> EOF >>>=20 >>> 3. Put point before "text2" >>> 4. M-x load-library RET treesit RET >>> 5. M-: (treesit-node-children (treesit-node-at (point) 'bash)) >>>=20 >>> =3D> (# >>> #) >>>=20 >>> Note that this list is incorrect, "$var2" at the end of heredoc is >>> missing. >>>=20 >>> 6. M-: (treesit-node-first-child-for-pos (treesit-node-at (point) = 'bash) (point)) >>>=20 >>> =3D> nil >>>=20 >>> Expected return value here is # >>>=20 >>> I'm not sure if this bug is on Emacs, tree-sitter-bash or even >>> tree-sitter itself and I don't know how to check. >>>=20 >>> tree-sitter-bash version: 0.19.0.r19.g77cf8a7-1 >>> tree-sitter version: 0.20.7-1 >>>=20 >>> Thanks and best regards. >>=20 >> Thanks. This is the tree produced by tree-sitter, does it match your >> expectation? >>=20 >> (heredoc_body >> (simple_expansion $ (variable_name)) >> (command_substitution $( >> (command >> name: (command_name (word)) >> argument: (word)) >> )) >> (simple_expansion $ (variable_name))) >>=20 >> treesit-node-at gives you the _smallest_ node at point, maybe = that=E2=80=99s why >> you didn=E2=80=99t see expected behavior? >>=20 >> Yuan >=20 > The latest commit to tree-sitter-bash is >=20 > commit 4488aa41406547e478636a4fcfd24f5bbc3f2f74 > Author: Jo=C3=A3o P. L. Carvalho > Date: Sun Nov 27 20:39:41 2022 -0700 >=20 > Fix scanning of heredoc_body to allow empty bodies (#137). >=20 > Seems like it has fixed the problem described in the 5. step and the > tree produced by tree-sitter is now expected. >=20 > The problem in the 6. step is still present though. With point in = front > of command_substitution, on would expect >=20 > (treesit-node-first-child-for-pos (treesit-node-at (point) 'bash) = (point)) >=20 > to return the command_substitution node instead of returning nil. What=E2=80=99s the return value of (treesit-node-at (point)) at that = point? Probably the command_substitution node, and since it doesn=E2=80=99= t have any children, treesit-node-first-child-for-pos would return nil. Yuan= From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 03 02:24:17 2022 Received: (at 59633) by debbugs.gnu.org; 3 Dec 2022 07:24:17 +0000 Received: from localhost ([127.0.0.1]:51324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1Msj-0005r1-5M for submit@debbugs.gnu.org; Sat, 03 Dec 2022 02:24:17 -0500 Received: from kamnitnik.top ([209.250.245.214]:55082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1Msd-0005qu-Gy for 59633@debbugs.gnu.org; Sat, 03 Dec 2022 02:24:16 -0500 From: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1670052249; bh=GtAwezd/sDVY6F/B/C9lwg4SfFXvk1tq5CZteGDgw/g=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Jdqvl0MtLbGaUjYcdW5W0zHfbY1KovTvsK7/gyIJXn/x3B0RaXTDdCF5tTeVCFCn0 ctEZSZvcuwXlk4a1uu9YtSjUjVykoui7yjXqgu4f4fcOlObzbFFFEL2d5Go1BmvE1+ Zu6WF/R5cEhI/G2/CQEGGpE1enPW/ENeNuTYp9JRwACiibyexY5uzWLoCTVkoAfXfY u9pqsEuWIqImmnX/YF9BaCBJDfk+8c8RXRldXQpis4UFETO2PynIB7xFFnz6jqU7KH 5psoI1pOm9DFyKkmpdMM7JoMXuKYrHHUK4ttS+2+9dNTRK+SxqAqa04fGJilhpKzfd sUeFBqLa+UQww== To: Yuan Fu Subject: Re: bug#59633: 29.0.50; tree-sitter-bash: Incorrect behaviour of heredocs with expansions In-Reply-To: <6767DDE2-911D-487F-A4B6-13DE8A0D0915@gmail.com> References: <871qpocq7s.fsf@miha-pc> <90FF5B60-A9AB-4101-9FE3-8FCAD8B9DCE8@gmail.com> <87o7slbwls.fsf@miha-pc> <6767DDE2-911D-487F-A4B6-13DE8A0D0915@gmail.com> Date: Sat, 03 Dec 2022 08:25:38 +0100 Message-ID: <87lenpaqz1.fsf@miha-pc> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Yuan Fu writes: > What’s the return value of (treesit-node-at (point)) at that point? > Probably the command_substitution node, and since it doesn’t have any > children, treesit-node-first-child-for-pos would ret [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FROM_SUSPICIOUS_NTLD From abused NTLD X-Debbugs-Envelope-To: 59633 Cc: 59633@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Yuan Fu writes: > What’s the return value of (treesit-node-at (point)) at that point? > Probably the command_substitution node, and since it doesn’t have any > children, treesit-node-first-child-for-pos would ret [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD 0.0 FROM_SUSPICIOUS_NTLD From abused NTLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Yuan Fu writes: > What=E2=80=99s the return value of (treesit-node-at (point)) at that poin= t? > Probably the command_substitution node, and since it doesn=E2=80=99t have= any > children, treesit-node-first-child-for-pos would return nil. (treesit-node-at (point) 'bash) =3D> # I forgot to say that point is before "text2", outside of the command_substitution node. > Yuan tee << EOF text1 $var text2 $(echo cmd) text3 $var2 EOF Filling a test buffer with these contents and placing point before "text2", we get (treesit-node-at (point) 'bash) =3D> # (treesit-node-children (treesit-node-at (point) 'bash)) =3D> (# # #) This is now expected. (point) =3D> 23 (treesit-node-first-child-for-pos (treesit-node-at (point) 'bash) (poin= t)) =3D> nil This is not expected. One would expect this to return command_substitution node, since it follows the position 23. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmOK+fITHG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZP6ICD/9SOspNmHn+GWN/qUerxqiBNdloX4+4 CvSnIZe2gSlaYdaTjvbUyPUoP4i/lk2NvxbFdhEgT5jZRK36GbUHG45y28Az6iAT oPRr0WArM4Tc38LgqK+NuYYaA9meueDw9/TyH/eOKAZB5kT2XT9uogCAI2u+L8Rx K7kyHO7WMBVlUzHBk6vjR80GP4alOFfjXVONNoocU0jvqLtMTn4I6x3Q2GQ7PmoI Esh/MLQ1Jhfrh3vaCwZPVJRAy207aNad8r/FwIzWl/WfDLV/ks0NAHbY9W4GMlvO Gof11Io205umUXxoD8h6DMaytS99q5jAihLQTrOA8+xeBVYT2JC8vKinYxqL093i piCJblxj/f1/i1K99Yu6+CElfAfgZ//PiBzSGKhRlJv/vm6mfVVMrO7nxR8e7C3A 2OuRke24zntMwQ12eH6qFV8k6WynbRkKnibFLU+I1zmeLGotxwHebSYHhYxrQ/cW ntfCCpD+1SOFP0U1ygh7/DlDb7hsW94dHDrfkjZO2E9XfllwMIlp04TWUheNwL9m xZEJaJtWEXwF0bT+j7IO+znhNGgk69NjjP/gBvrllbw0DDQ4w2LmF/YJizU6QWz/ VCWimtj8dlbTKiG8m4upCnNOjYWDV+E+OrNvmFc/Ahrb2ZedYcTCX7/xEGIkQwr7 nr5+ymct0BRFUQ== =5HLf -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 09 17:11:06 2022 Received: (at 59633) by debbugs.gnu.org; 9 Dec 2022 22:11:07 +0000 Received: from localhost ([127.0.0.1]:38815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3laE-0006VW-JD for submit@debbugs.gnu.org; Fri, 09 Dec 2022 17:11:06 -0500 Received: from mail-pj1-f41.google.com ([209.85.216.41]:38895) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3laC-0006V7-1Q for 59633@debbugs.gnu.org; Fri, 09 Dec 2022 17:11:05 -0500 Received: by mail-pj1-f41.google.com with SMTP id z8-20020a17090abd8800b00219ed30ce47so9581909pjr.3 for <59633@debbugs.gnu.org>; Fri, 09 Dec 2022 14:11:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=LaHap0siDG0tWX5+xDUGs7kr7UDkrKS/2ssEHwHpw48=; b=dZlr5UGBlieyEm+PHWmsLN+W43plcXaw3AmEfKudgfB39hUDBzpvQJZWgz1GnAjpKj Ak4+HxD0ki+ubacX0cq096a2yI1SwNhDFP6uK+7UBCC5Qnke038R7O2i68Ojsy8XCgSO S5SYsyVrrXuNhyPAtKomC8TUOqdbzIPVF1yjQfyLYXSJdqqbvyvGToIzb/gaIHHKCHIy sKYEPBB7AwWUS+CmU6/8esejzPvIOpOGld3NTZhuaetj0Q9MzfjAa6rbnohoiG1ovjLp RWh8QELJDoTjPR71R5tiNnDod4UOSZSvcdfQCLedIygHZDMmuAECvWhwi52X9ARZZBna PzaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LaHap0siDG0tWX5+xDUGs7kr7UDkrKS/2ssEHwHpw48=; b=aOxM0xYk1HSTOoL8FvmMToZdV6BAg1Wh8vBPLEOfRHuzqNDWa78ULnsof9/QzJ9F2a f2+7BQPW3Nk2nF33RdzlJiM3q9oF5+/S58FvKyGPNG4kKCUdxqry9hE3ptLocz6VHanM A+LnpcYB9g58I/PSjgTGZO8286Ke5LxuQ4O23BjKTrnkKUvd7ccIGU4H3LZdkWrq7sWQ rO6Nvk7P5WBhlZKbSnap2MLP1QQkO/wD5jf6bDg+VnWA2Pki6m6p+/bhVQQjmr9O9R3N fhTQ8ha0UIzCKG95g6Y0xG7pin/fsTJrm9jmAyPE7V/vX4Vl4E4lov/Kea8kPb4wxpKB NLfA== X-Gm-Message-State: ANoB5pmeFeNpSkGjXbiNUsiQDjHvBBdoIcFRSalnpQ8quxpkA5ggKzuy du1uclt8Mn6FwmB/vofh1920ia7wf9txlg== X-Google-Smtp-Source: AA0mqf608K1ZYW7oHaAFYhrxvlqJrn8RBE42gici+6t9KXySbetcRmIG8tLMoox6I9KFdiUuQMvlLA== X-Received: by 2002:a05:6300:8107:b0:a7:8ad5:4346 with SMTP id bs7-20020a056300810700b000a78ad54346mr7905151pzc.62.1670623858141; Fri, 09 Dec 2022 14:10:58 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id l7-20020a635707000000b004788780dd8esm1372761pgb.63.2022.12.09.14.10.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Dec 2022 14:10:57 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#59633: 29.0.50; tree-sitter-bash: Incorrect behaviour of heredocs with expansions Message-Id: <4702319F-E4AF-44DB-BA2D-4A05B1FFBAB6@gmail.com> Date: Fri, 9 Dec 2022 14:10:55 -0800 To: miha@kamnitnik.top X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: writes: > Yuan Fu writes: > >> What’s the return value of (treesit-node-at (point)) at that point? >> Probably the command_substitution node, and since it doesn’t have any >> children, treesit-node-firs [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (casouri[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.216.41 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.216.41 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 59633 Cc: 59633@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) writes: > Yuan Fu writes: > >> What=E2=80=99s the return value of (treesit-node-at (point)) at that = point? >> Probably the command_substitution node, and since it doesn=E2=80=99t = have any >> children, treesit-node-first-child-for-pos would return nil. > > (treesit-node-at (point) 'bash) > =3D> # > > I forgot to say that point is before "text2", outside of the > command_substitution node. > >> Yuan > > tee << EOF > text1 $var > text2 $(echo cmd) > text3 > $var2 > EOF > > > Filling a test buffer with these contents and placing point before > "text2", we get > > (treesit-node-at (point) 'bash) > =3D> # > > (treesit-node-children (treesit-node-at (point) 'bash)) > =3D> (# > # > #) > > This is now expected. > > (point) > =3D> 23 > > (treesit-node-first-child-for-pos (treesit-node-at (point) 'bash) = (point)) > =3D> nil > > This is not expected. One would expect this to return > command_substitution node, since it follows the position 23. Ah, I (finally) see what you mean. I agree that it should return the command_substitution node. It seems that tree-sitter returns nil whenever POS is not in a child node. I need to see what=E2=80=99s the = problem here since treesit-node-first-child-for-pos is just a think wrapper around the C counterpart. Yuan From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 13 23:01:42 2022 Received: (at 59633) by debbugs.gnu.org; 14 Dec 2022 04:01:42 +0000 Received: from localhost ([127.0.0.1]:36437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5Ixh-0001OC-Qx for submit@debbugs.gnu.org; Tue, 13 Dec 2022 23:01:42 -0500 Received: from mail-pl1-f170.google.com ([209.85.214.170]:42962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5Ixf-0001O6-0C for 59633@debbugs.gnu.org; Tue, 13 Dec 2022 23:01:39 -0500 Received: by mail-pl1-f170.google.com with SMTP id d7so2058676pll.9 for <59633@debbugs.gnu.org>; Tue, 13 Dec 2022 20:01:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=XML92rZJYomhDah/X+zwyWP1sZHElfyYnp8C9bqqSVg=; b=bmH3KgR8jM6xJ4gZTabtMp96pVT+fJYuO2OLZ5lb6tvczWWcKdQ0VY33btD+BvCOLM FPNdSeUeckFXfu/i2jFWRnI3rUMKpVxC+YkXCEaGPI6cg+CYVocNSqyrYZZtj10fus6k K96DHdI7o4FM3cr0XfuULnJyNGUgvRcRJKORgOwczfr4A0lf8yGbBn3HykryPwSknlMD ztsCt8BUwYXBGDCnet7DeaIDfPYI7DcltOerLljsGnZqpiWxgna8wFEIHZkCERj2pkA0 Z0uDeqnz9gc+cPfqAj7HADbmVHA6dmyhmUaf8DrcDj3nFqkYi4Unamx21RHC3Dd5jK2p iIDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XML92rZJYomhDah/X+zwyWP1sZHElfyYnp8C9bqqSVg=; b=TFiYVDCmfrDkFdVijzimoY0/67AemAx3dz0v/dapQYHcnw7Z5snfw/cQO7wgHUG2ax tlWUeH6x3BP4d891bqgdHLbSYn4bd4fzBlF0gw78eZctKp1sUrkYKY4+Zrsk1ZrCFrXH pKLR9dab+M2dswAbnwFPklPJmzmbPR0zNwYBD79dB+1uBioW/DafFOeVBsOjWnHMoc2d QpepuEYQ7WGwW3ThT+xA5s3U14OkHT0pgsPTTWsY93plho/jZbybfwlom8FM637rU5nR kM+aVmFKrASSuv67k3oNdHQ7GWaoRTFzRf/ghF1vvvoBSVTKpgv5/tl0bjquQOuO12Zh EpbQ== X-Gm-Message-State: ANoB5pmh7U+Ve/P6Dp1CoDDTk/t05set6TgUcpM2C5afayfHdm+t1zoH 5yZ/dIS3ZyXbmDici5Qc9A5ZbwMkOgTIAg== X-Google-Smtp-Source: AA0mqf5gcYTN3pz6Vy4aZndZ72D1ZhCxi/XaZBMN/0ovPgHZBbxtGERUpV/vQG4nQ1fVmrh0eMIRMg== X-Received: by 2002:a17:90a:fc95:b0:218:ff8e:5d6b with SMTP id ci21-20020a17090afc9500b00218ff8e5d6bmr23375568pjb.16.1670990493025; Tue, 13 Dec 2022 20:01:33 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id e13-20020a17090a7c4d00b00218e8a0d7f0sm284571pjl.22.2022.12.13.20.01.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Dec 2022 20:01:32 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#59633: 29.0.50; tree-sitter-bash: Incorrect behaviour of heredocs with expansions Message-Id: <91CDE39D-4598-480D-B84B-5E3E152B15BC@gmail.com> Date: Tue, 13 Dec 2022 20:01:31 -0800 To: miha@kamnitnik.top X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Yuan Fu writes: > writes: > >> Yuan Fu writes: >> >>> What’s the return value of (treesit-node-at (point)) at that point? >>> Probably the command_substitution node, and since it doesn’t have any >>> children [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (casouri[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.214.170 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.214.170 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 59633 Cc: 59633@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Yuan Fu writes: > writes: > >> Yuan Fu writes: >> >>> What=E2=80=99s the return value of (treesit-node-at (point)) at that = point? >>> Probably the command_substitution node, and since it doesn=E2=80=99t = have any >>> children, treesit-node-first-child-for-pos would return nil. >> >> (treesit-node-at (point) 'bash) >> =3D> # >> >> I forgot to say that point is before "text2", outside of the >> command_substitution node. >> >>> Yuan >> >> tee << EOF >> text1 $var >> text2 $(echo cmd) >> text3 >> $var2 >> EOF >> >> >> Filling a test buffer with these contents and placing point before >> "text2", we get >> >> (treesit-node-at (point) 'bash) >> =3D> # >> >> (treesit-node-children (treesit-node-at (point) 'bash)) >> =3D> (# >> # >> #) >> >> This is now expected. >> >> (point) >> =3D> 23 >> >> (treesit-node-first-child-for-pos (treesit-node-at (point) 'bash) = (point)) >> =3D> nil >> >> This is not expected. One would expect this to return >> command_substitution node, since it follows the position 23. > > Ah, I (finally) see what you mean. I agree that it should return the > command_substitution node. It seems that tree-sitter returns nil > whenever POS is not in a child node. I need to see what=E2=80=99s the = problem > here since treesit-node-first-child-for-pos is just a think wrapper > around the C counterpart. Seems to be tree-sitter-bash problem, I submitted an issue at https://github.com/tree-sitter/tree-sitter-bash/issues/139 Yuan From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 14 10:05:28 2022 Received: (at 59633-done) by debbugs.gnu.org; 14 Dec 2022 15:05:28 +0000 Received: from localhost ([127.0.0.1]:39780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5TK3-00043N-Uj for submit@debbugs.gnu.org; Wed, 14 Dec 2022 10:05:28 -0500 Received: from kamnitnik.top ([209.250.245.214]:39230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5TJx-000433-Tl for 59633-done@debbugs.gnu.org; Wed, 14 Dec 2022 10:05:26 -0500 From: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1671030320; bh=5VxkGjjpLW8vSwuAnt4DcevQ4ipzQCJIjewXwWSfKp4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=aBcpLec43a5pkcaYLq4DVTFTH2eSUfoxmRnFduOSrFv5anYYscMDFRR6KoJtPAATm GkcLPUjsenLXQlwdrVFtt0J1Ee+CJqjYhDa/vb6RVd2k7j5/42IsPCrJn32zI2U1H+ xV1BUuEOIMHtxqWi0rBEqZ/h1rWJ+TynzfWbpt9sczZb06nAV4FmNzwN0d1ZsFoayA Fmmu06Aw8+ROGggPhnKilmNBp11qicro2m/+FQ03xRuGl90+jetoh5R5NefGQ7cyLr xURxKr2CSZ44nTj7Uy7D4pwWzg+0YHpPoQipmD8hEH9kKHNfciW764XURU5R6z6wJ1 6I63DS2NFgoLQ== To: Yuan Fu Subject: Re: bug#59633: 29.0.50; tree-sitter-bash: Incorrect behaviour of heredocs with expansions In-Reply-To: <91CDE39D-4598-480D-B84B-5E3E152B15BC@gmail.com> References: <871qpocq7s.fsf@miha-pc> <91CDE39D-4598-480D-B84B-5E3E152B15BC@gmail.com> Date: Wed, 14 Dec 2022 16:07:10 +0100 Message-ID: <87sfhiaush.fsf@miha-pc> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Yuan Fu writes: > Seems to be tree-sitter-bash problem, I submitted an issue at > https://github.com/tree-sitter/tree-sitter-bash/issues/139 Thanks. As this seems to be a tree-sitter-bash problem, I'm closing this bug. Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FROM_SUSPICIOUS_NTLD From abused NTLD X-Debbugs-Envelope-To: 59633-done Cc: 59633-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Yuan Fu writes: > Seems to be tree-sitter-bash problem, I submitted an issue at > https://github.com/tree-sitter/tree-sitter-bash/issues/139 Thanks. As this seems to be a tree-sitter-bash problem, I'm closing this bug. Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD 0.0 FROM_SUSPICIOUS_NTLD From abused NTLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --=-=-= Content-Type: text/plain Yuan Fu writes: > Seems to be tree-sitter-bash problem, I submitted an issue at > https://github.com/tree-sitter/tree-sitter-bash/issues/139 Thanks. As this seems to be a tree-sitter-bash problem, I'm closing this bug. > Yuan --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmOZ5p4THG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZP2v+D/9F6iB3v3/bLs9iE41tdyp8uDZv8QJc JYvj38j4p68pgOZLbMV8EvHnaxjiQjyRSifLIknihDyPBFLaLvBtHIttirIS+Fw+ wiI0lMe3HxUlFuTiWZeN1Cpzllbr/FN5u1sPgQbgR4lhy4qqCCsTd+3UCDXibEi8 TAPtSZB9YxYc+qRMKTkP3JanKtFql/krL7XPf+eWvzm5j+0ixX5pGRQOWBmpTLYS nMA5F0dbKF7PhRtVUmP5FpQbmeCZRkgSGTVjsGalH3C8OBgpOrSnrOcBV2YEHZAt W6H1v7UUVodyEuWRE7ydJNmmWAEqNA2/c+CM0Z9FQZgRTih0cZEMCE52bEhMmOfG AsCdFY6DX2ck14qOLZZYE/jsK9IiL8O3/xGbn4v/gxvE47zaxFPdURUlXaeajemE A8HMJjOzeecC05t7vcZfoBDvhgQEnZmrIjfTBn6PbqAZRGvvQnenqu1WQFAH9zbO w81kfKsYjtNf3YTwpyHmReRsr+RTycIGXeS200ia3SgES1D9xnJihQsc4eCPp1io 3TMsON4GIxVanvDf7GwtY9ZTPZ1Rq48N7aYSdUWks38rcIODQ7W6DyyUg7JEjkDl BjimyeG5vh+NfM2GjhY3R4WjFX/3p3p0aWAcK6IY1TotdMWtby0fwSVP26jCtHjm lk9yV1NCyqR3zg== =32fe -----END PGP SIGNATURE----- --=-=-=-- From unknown Thu Sep 11 00:38:34 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 12 Jan 2023 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator