From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Status update of tree-sitter features Date: Wed, 28 Dec 2022 16:15:45 -0800 Message-ID: References: <87mt77cz0x.fsf@fyeah.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) 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="15928"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Mickey Petersen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 29 01:16:40 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 1pAgbA-00043c-Ov for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Dec 2022 01:16:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAgaP-00081g-4a; Wed, 28 Dec 2022 19:15:53 -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 1pAgaN-0007zR-8C for emacs-devel@gnu.org; Wed, 28 Dec 2022 19:15:52 -0500 Original-Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pAgaK-0004dr-QQ for emacs-devel@gnu.org; Wed, 28 Dec 2022 19:15:50 -0500 Original-Received: by mail-pf1-x436.google.com with SMTP id w26so11672897pfj.6 for ; Wed, 28 Dec 2022 16:15:48 -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=M2oDEjmLBaI6OT4LrarAT0rx1Didgr0ddrDgo+e5ito=; b=AP74k2NiRy7rTlN5mie7vjO0qLhmF7kqiD/QTih3HrYE0mkqPrSeBqHvlamG8o1k/i ubL42Bm3e/rQ6RXXSRlqHbjIMv4EmzTjKwON9EzZZtFUxLoLw3mGazzCBb20cofspfs7 bqIeXEeXnIYkxDYHQOXpFYYGTQzaizScjB+zw7bDor+YNe/VkKNCLJe91E/Sk9g9F+eU 9/BVVAbnhdRfRN5y5HUPSlHvoQvvbq9u5sWABkA/RMTFkTbK0af9HOQGESLXAX5M1ERp wsATqRdfSbniGVEtWFvl4afJ4gY8YwcsduT5+VQTRzZPkaEp9XPnFM5/TyobQ/XQ5pGD SuxQ== 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=M2oDEjmLBaI6OT4LrarAT0rx1Didgr0ddrDgo+e5ito=; b=XdTXV/As8ikgZ8BYcgqrOAKzGvTvgL+63X0k7uQ7llGaN7CLNw3k+6supVd3MowHeJ iOtkfz9Los/+4WNSElF79Zqjljyu2anLGzXmlAfAhssp6oy3NBVxAGH90ZhFaGJAFKob 5EOXF08WJUnLTM7PlagjJKclHY3VZOoLZ4kqTTFd/XZUqFwAx2pYMmoZ+HgvQTvCdwNe dtaPPYrqo1v3r24pM3TlaxtvyF63YqAjYz6fIzSVZnj1Y0ZjdrUK4j14ZC+xO+IJ3BaW cxBgWYcym+vqO16dJ5iPSHJOhJZsZovRB98M8LKc8Wm84yfVC49T+bcAHCLRtr9POHSz LkAA== X-Gm-Message-State: AFqh2kp6InFPa28hT3fCKW/kcOGG/nqyGXSRfVGsBoTDES/9X66J/VPv 9prFXcT0h3HwRo/wnrqNu7OPNhxJrHE= X-Google-Smtp-Source: AMrXdXsS/twCEsJPdN8Z5TumLpDebTSGKqPwF7AmgQ/7ToXqONs6dyPqsFZYIkDR8CvauLOhYd2lYA== X-Received: by 2002:a62:6102:0:b0:578:3bc0:57d7 with SMTP id v2-20020a626102000000b005783bc057d7mr26485104pfb.13.1672272947019; Wed, 28 Dec 2022 16:15:47 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id 21-20020a621515000000b005813aec74bdsm5211651pfv.139.2022.12.28.16.15.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Dec 2022 16:15:46 -0800 (PST) In-Reply-To: <87mt77cz0x.fsf@fyeah.org> X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=casouri@gmail.com; helo=mail-pf1-x436.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, 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:302017 Archived-At: >=20 > Looks useful. But this, I think, goes back to the issue I raised with = you in an email: that queries are recursive, as each query is (I = pressume this is how it is done in tree-sitter) applied to each node in = the tree. That makes it very hard to build a query that pattern matches = against nested nodes only once. It is very hard, when you have recursive = queries with self-similar matches, to filter out recursed matches. = Particularly when you are writing generic code that merely acts on the = output of arbitrary queries. >=20 > #pred is surely no different to applying `seq-filter' or similar to = the query result, no? No, I don=E2=80=99t think there=E2=80=99s any significant difference. = #pred is just a bit nicer for other people to use the query, because the = filter is embedded in the query. Yuan