From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel =?UTF-8?Q?Mart=C3=ADn?= via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#60555: 29.0.50; Some clarification is needed about "smaller" and "larger" Tree-sitter nodes Date: Thu, 05 Jan 2023 00:05:43 +0100 Message-ID: References: <83cz7uz6rl.fsf@gnu.org> Reply-To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20425"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) Cc: 60555@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 05 00:06:33 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1pDCq7-00050D-72 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Jan 2023 00:06:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDCph-00077r-LX; Wed, 04 Jan 2023 18:06:05 -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 1pDCpe-00075s-HJ for bug-gnu-emacs@gnu.org; Wed, 04 Jan 2023 18:06:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pDCpe-0003xd-96 for bug-gnu-emacs@gnu.org; Wed, 04 Jan 2023 18:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pDCpd-0007ic-NX for bug-gnu-emacs@gnu.org; Wed, 04 Jan 2023 18:06:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Jan 2023 23:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60555 X-GNU-PR-Package: emacs Original-Received: via spool by 60555-submit@debbugs.gnu.org id=B60555.167287355829660 (code B ref 60555); Wed, 04 Jan 2023 23:06:01 +0000 Original-Received: (at 60555) by debbugs.gnu.org; 4 Jan 2023 23:05:58 +0000 Original-Received: from localhost ([127.0.0.1]:49849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDCpZ-0007iJ-OH for submit@debbugs.gnu.org; Wed, 04 Jan 2023 18:05:58 -0500 Original-Received: from sonic313-21.consmr.mail.ir2.yahoo.com ([77.238.179.188]:42501) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDCpX-0007i4-87 for 60555@debbugs.gnu.org; Wed, 04 Jan 2023 18:05:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1672873549; bh=xY29gbM3sHRZz7G3rqp1cgK9WnbrEKbcrnHhabvryPY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=o594+4FG/rs7zq9lvCxaRYs6tFjmOXljEnuprtRIKe9d74QFzoLHTgZ2oYzc+Z1OolFMUAYEd292NyxRBw6at2HPjH92v+1vMlIzOpVTGvu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gdpF.bNCrWSm1PlwHHwCfsR5BsgNZGSsNS1AHbok40t_r b3FB2gjTp9TrPD0cXK0Z6OJLTbK2V2ncIppAZQ7arhahRSIrNJ6zMG8YeYOjkiIl3NgADFRxRixt M8O8Wwwa2pgnWT4ie0rXcOl4S8f_pxbsbbn5g6vo_qcbncF_qZV9YZfR3XIlOX32quFdxw71TFt5 EwWze7aGBlRlAEw59UqcTCIYIvkxZsVW4_FPZ_DJ37uc137PIiCn2ouuPbzWdwpp8ztHIFVCtLzZ 6PQhOpNvrvDdOrw8EfIulirksH1RfRYcw3R8LOFGY1EClIUewTwOqpErmxRv97edxyerW6CKbbj_ 8ZztZFD7P9qCsIDMBKHpE0Z8dqz9_pha7AbdI7N34B9ehH7TXX6AMZ4voR1Ohm9AEKFGzir4IGKs HceRQr5Lyr0m_hrkuWZADFE8znfD0bQAPUs4196hitLIvK42Ljm8F2K00XeyjDgE37XnbO43CAxe .64XA4Tw3wU3AKl6UTAJDDkKUIMdsGILA46i5cohNm X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ir2.yahoo.com with HTTP; Wed, 4 Jan 2023 23:05:49 +0000 Original-Received: by hermes--production-ir2-5795fc58c8-j5s6m (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID ecb10347f474ee0f911faed83c1e61fa; Wed, 04 Jan 2023 23:05:45 +0000 (UTC) In-Reply-To: <83cz7uz6rl.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 04 Jan 2023 16:58:06 +0200") X-Mailer: WebService/1.1.20982 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:252545 Archived-At: Eli Zaretskii writes: >> Date: Wed, 04 Jan 2023 15:29:14 +0100 >> From: Daniel Mart=C3=ADn via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >>=20 >>=20 >> In the Elisp manual, under "37.3 Retrieving Nodes" there is this text: >>=20 >> We talk about a node being =E2=80=9Csmaller=E2=80=9D or =E2=80=9Clarg= er=E2=80=9D, and =E2=80=9Clower=E2=80=9D or >> =E2=80=9Chigher=E2=80=9D. A smaller and lower node is lower in the synt= ax tree and >> therefore spans a smaller portion of buffer text; a larger and higher >> node is higher up in the syntax tree, it contains many smaller nodes as >> its children, and therefore spans a larger portion of text. >>=20 >> I think the concepts of nodes being "lower" and "higher" are more or >> less clear, and the notation is similar to the one used in classic texts >> about rooted trees. However, the concepts of "smaller" and "larger" are >> not very clear to me. From the text, it seems that "lower" also means >> "smaller", and "higher" always means "larger". Is that correct, or >> "smaller" and "larger" are really orthogonal to "lower" and "higher"? > > They aren't orthogonal, AFAIU. The text actually says that "lower" > necessarily also means "smaller". If that's the case, I don't feel the text is clear enough about the "necessarily" part. I think the text would be more clear if the first sentence was We talk about a node being =E2=80=9Csmaller=E2=80=9D (or "lower") and =E2= =80=9Clarger=E2=80=9D (or =E2=80=9Chigher=E2=80=9D). The next sentence should avoid "smaller and lower" and "larger and higher", because it'd be redundant (can a node be "smaller and higher"?). That is, I suggest the following text instead: A smaller node is lower in the syntax tree and therefore spans a smaller portion of buffer text; a larger node is higher up in the syntax tree, it contains many smaller nodes as its children, and therefore spans a larger portion of text. Thanks.