From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill Newsgroups: gmane.emacs.devel Subject: Re: Tree sitter support for C-like languages Date: Sat, 12 Nov 2022 21:03:19 +0100 Message-ID: <87y1sggcu0.fsf@thornhill.no> References: <87tu36em9t.fsf@thornhill.no> <45FD2F78-F15B-488B-9348-A8E298D8AD35@gmail.com> <87v8nmyqqp.fsf@thornhill.no> <834jv4nz2g.fsf@gnu.org> <871qq8hsj1.fsf@thornhill.no> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3706"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, emacs-devel@gnu.org, Stefan Monnier To: Stefan Kangas , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 12 21:03:55 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 1otwjK-0000lf-FO for ged-emacs-devel@m.gmane-mx.org; Sat, 12 Nov 2022 21:03:54 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1otwiz-0001pt-Ss; Sat, 12 Nov 2022 15:03:33 -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 1otwiz-0001pb-08 for emacs-devel@gnu.org; Sat, 12 Nov 2022 15:03:33 -0500 Original-Received: from out2.migadu.com ([188.165.223.204]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1otwiv-0003Qk-GP; Sat, 12 Nov 2022 15:03:31 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1668283406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5HnREDCiiGLOzMJafEGri885IQzl5OeejhnKc6dampA=; b=d6vdDfv9sJInuzSNCsB4cPKhrg4P7J3FsP6Stf1Wlbw/ZoqZ460G0VtCoShvkyg/mdSQqZ TzdLDAD/35Se9hro2zCbsYVCgIJecoydYK4w7+VhqSto7YdPQNqjWAxWpKKtJ0dHqVDPE5 61OxDblJnvArnclFto28E5nUNePFSPGVQhroPvogkMoXHAj8BZvL6ZYZbeUt1mSPVmjJz4 0Df3NUJHMAc78EIkcZ6MY11aatOsfD5y7WjMlEs3f7JtqTdGWwWJ542qbx7LQWImSnJY1L 7WDKC7eZdce9CdF+oQzpfGLw/Vyv+3KAjJe96+LtA4JntMhhrtxU4Hn9keq2Ew== In-Reply-To: X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=188.165.223.204; envelope-from=theo@thornhill.no; helo=out2.migadu.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, SPF_HELO_PASS=-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:299678 Archived-At: Stefan Kangas writes: > Theodor Thornhill via "Emacs development discussions." > writes: > >> See below patch. Please note that I now have merged C and C++ into one >> file, and both inherit from a new parent mode: 'c-ts-mode--base-mode'. >> I simplified some of the indentation rules as well. > > Is it really a good idea to put C and C++ support in the same file? > Initially I thought no, but I have no strong opinions on this > Also, the patch seems to be adding two files, but the commit message > only mentions one of them? > You are correct. Forgot to remove the old mode. I'll fix it in upcoming patch... Sorry, but thanks for the nice catch! >> From 0d6e144b9a90cfd72f5cdc8480d5bbe70c281fc5 Mon Sep 17 00:00:00 2001 >> From: Theodor Thornhill >> Date: Thu, 10 Nov 2022 17:15:49 +0100 >> Subject: [PATCH] Add Tree Sitter modes for C-like languages >> >> * etc/NEWS: Mention the new modes >> * lisp/progmodes/c-ts-mode.el: New major mode with Tree Sitter support >> for C and C++. >> * lisp/progmodes/java-ts-mode.el: New major mode with Tree Sitter support. >> * lisp/progmodes/json-ts-mode.el: New major mode with Tree Sitter support. >> * lisp/progmodes/css-ts-mode.el: New major mode with Tree Sitter support. >> --- >> etc/NEWS | 32 ++- >> lisp/progmodes/c++-ts-mode.el | 424 +++++++++++++++++++++++++++++++ >> lisp/progmodes/c-ts-mode.el | 445 +++++++++++++++++++++++++++++++++ >> lisp/progmodes/css-ts-mode.el | 131 ++++++++++ >> lisp/progmodes/java-ts-mode.el | 289 +++++++++++++++++++++ >> lisp/progmodes/json-ts-mode.el | 150 +++++++++++ >> 6 files changed, 1467 insertions(+), 4 deletions(-) >> create mode 100644 lisp/progmodes/c++-ts-mode.el >> create mode 100644 lisp/progmodes/c-ts-mode.el >> create mode 100644 lisp/progmodes/css-ts-mode.el >> create mode 100644 lisp/progmodes/java-ts-mode.el >> create mode 100644 lisp/progmodes/json-ts-mode.el > [...] -- Theo