From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: A few questions about c++-ts-mode. Date: Thu, 09 May 2024 08:53:01 +0300 Message-ID: <86cypv8rb6.fsf@gnu.org> References: <865xvoa0jr.fsf@gnu.org> <86jzk38tm7.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20993"; mail-complaints-to="usenet@ciao.gmane.io" Cc: spacibba@aol.com, emacs-devel@gnu.org, casouri@gmail.com To: Filippo Argiolas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 09 07:54:27 2024 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 1s4wjZ-0005PU-TR for ged-emacs-devel@m.gmane-mx.org; Thu, 09 May 2024 07:54:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4wiL-0003k9-4T; Thu, 09 May 2024 01:53:09 -0400 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 1s4wiI-0003in-EB for emacs-devel@gnu.org; Thu, 09 May 2024 01:53:07 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s4wiH-0000A9-UZ; Thu, 09 May 2024 01:53:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=GivzC2isw5AOZxo2uo65A80j5u0Gu4UIuTmobBp7fG8=; b=B76Fs+gpNyaH mu77uw6gEPNTT+Bb/40H7BNLgIVU4bOso5bWHVo0qNUKycKnHgNOZi3w/kHY08IKGAZeXShtBceh4 2X7xgxKWeB4rjE4nXqUSpkrysSBu2lxdMpOAhqpoqFG4mostDvokiEmYnHuKcuE3T+ed4a2uaG19k qzdkUCY/oa79pfe+w2kogu7fPC3G9hjJTFlf+Pq5fJJScWXhYTyBCr2TqhEPy1cXoGWYZQyPK0E0Y 41kdbCz3QZjZamuQxrM9Byh1MXl2FKL7TRC3U9VDl3gOfeMVGReoJX+9FlQFWm5NW8ujz36DvSVIc 5LrRBqbSGUzFnxWTfaMT/Q==; In-Reply-To: (message from Filippo Argiolas on Thu, 9 May 2024 07:34:58 +0200) 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:319043 Archived-At: > From: Filippo Argiolas > Date: Thu, 9 May 2024 07:34:58 +0200 > Cc: Ergus , emacs-devel@gnu.org, casouri@gmail.com > > > If the only solution is language injection, then doing that our usual > > way (with regexps etc.) is easier and more flexible. I thought I saw > > some commits in the C++ grammar that actually support that in the > > grammar itself. If there is such support, we should use it, IMO. > > > > Sorry to intrude, may I ask what's the problem with language > injection? it seems the perfect use case for this. I didn't say there was a problem, I said that doing it with regexp etc. would be easier and more flexible. Language injection AFAIU requires an additional grammar library, which means someone must compile it, the end-user must ensure it's installed, etc. IOW, it makes the disadvantages of tree-sitter more prominent, for the benefit of a very minor feature. From where I stand, that makes the balance tip in favor of the simpler solution, which users could more easily activate and customize.