From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.devel Subject: Re: RFR cc-langs.el: change syntax for @ in Java Date: Thu, 08 Apr 2021 20:26:49 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25955"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 08 19:32:00 2021 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 1lUYVc-0006fU-4C for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Apr 2021 19:32:00 +0200 Original-Received: from localhost ([::1]:43614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUYVa-0004HY-Kj for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Apr 2021 13:31:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUYQr-0001kD-E6 for emacs-devel@gnu.org; Thu, 08 Apr 2021 13:27:09 -0400 Original-Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:50751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUYQj-0007Mk-2Z for emacs-devel@gnu.org; Thu, 08 Apr 2021 13:27:04 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 3CE681B0; Thu, 8 Apr 2021 13:26:54 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 08 Apr 2021 13:26:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=MzUCXH2k3HHHHIFf2/1SpqTdKy uyeSwL8D3Xtylgtmw=; b=cOUrEt9E9UcCPpFSsHU9uI6ujayPMcAyJNgVhfqGm4 BLzSzQvxXgg2d+IZEciM7dQXuFsIo0Pt2wT6tcAub/y3wzbPwg7pIaIK1A4f3+uf EcVIJ3YOzc4NB18Al92BAuW+2lmRuTvcGliiyEi1ujq8qT16epVkQ3rzcBxFV7TX oR9rM8c/o4j5BvQOPWH1ndlJ8Hw6zRC3Ic+AflCC80P6eLcl+cJrglwH9q5ZF+SO fgNC1ESZpqjIGujseXCixvkM+3j68/QjrCwZdUEmZ73mLjWp81fqpn2D/m32Duhs YaQSLyUAUbaEM52OOtf3qqQ7rZfnoY1iVdeWd1JMiyzQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=MzUCXH 2k3HHHHIFf2/1SpqTdKyuyeSwL8D3Xtylgtmw=; b=aZEdSriamBMUheOFxksHhS J3Kc2S/cfC1Sh+nPp62a+I4xPxJ/no3W5qrJSQT6qEHlDyABkB6KSKLDWnZQtRVq vOxRCULiRyXWkpbRdKj5I9nQqPeply4wE68Hh8prUm5T3+09OKii+ZJIrvqiSGAu pyl3k++TBs1ssePVePZgdvzEFGQO08F/B8SXsEeN1m93tmRafj3U/ecZAQY65FlN jVFS2DF+XQqF2M3GDsZKmjOLB5/Hax+r2WAvF2xp5A2qyTHnZW1Y/a8BJMuwRszD Pxwumf5WiRLfC38Sz8tTaqB3GaT9/rPHE3YaAi8r0LwP89KdaQEZ/LgYh6W8ydFQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudejledgudduhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufgjfhgffffkgggtsehttd ertddtredtnecuhfhrohhmpefhihhlihhpphcuifhunhgsihhnuceofhhguhhnsghinhes fhgrshhtmhgrihhlrdhfmheqnecuggftrfgrthhtvghrnhepvdevkeffvdeuvefhuddtje ehkedvueefveettddtveduudfgieffieevieevhfdtnecukfhppeekgedrvddtgedrudel fedruddtieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehfghhunhgsihhnsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: from fgunbin.local (unknown [84.204.193.106]) by mail.messagingengine.com (Postfix) with ESMTPA id 197D91080063; Thu, 8 Apr 2021 13:26:52 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Thu, 8 Apr 2021 10:15:31 +0000") Mail-Followup-To: Alan Mackenzie , emacs-devel@gnu.org Received-SPF: pass client-ip=64.147.123.21; envelope-from=fgunbin@fastmail.fm; helo=wout5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 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" Xref: news.gmane.io gmane.emacs.devel:267637 Archived-At: Hi Alan, On 08/04/2021 10:15 +0000, Alan Mackenzie wrote: > I've just run the CC Mode test suite with this amendment, and it > produces the following successes on annotations-1.java: > > annotations-1.java:4: Expected analysis ((inclass 1) (topmost-intro 21)), got ((inclass 21) (topmost-intro 21)) > annotations-1.java:4: Expected indentation 0, got 32 > annotations-1.java:5: Expected analysis ((class-close 1)), got ((class-close 21)) > > .. So, there are things to sort out before we can apply the change. I think these breakages are not real breakages, but rather the resfile could be updated. This class: --8<---------------cut here---------------start------------->8--- @NonNull @TestClass @FooBar public class Annotations { } --8<---------------cut here---------------end--------------->8--- previosly "started" at the @NonNull line, but now "starts" at @FooBar line, which is absolutely correct. So here's the updated patch (now against the cc-mode repo). Thanks. diff -r 10abd4587dad cc-langs.el --- a/cc-langs.el Mon Mar 29 15:20:53 2021 +0000 +++ b/cc-langs.el Thu Apr 08 20:22:56 2021 +0300 @@ -365,12 +365,14 @@ (let ((table (make-syntax-table))) (c-populate-syntax-table table) ;; Mode specific syntaxes. - ,(cond ((or (c-major-mode-is 'objc-mode) (c-major-mode-is 'java-mode)) + ,(cond ((c-major-mode-is 'objc-mode) ;; Let '@' be part of symbols in ObjC to cope with ;; its compiler directives as single keyword tokens. ;; This is then necessary since it's assumed that ;; every keyword is a single symbol. `(modify-syntax-entry ?@ "_" table)) + ((c-major-mode-is 'java-mode) + `(modify-syntax-entry ?@ "'" table)) ((c-major-mode-is 'pike-mode) `(modify-syntax-entry ?@ "." table))) table))) diff -r 10abd4587dad tests/annotations-1.res --- a/tests/annotations-1.res Mon Mar 29 15:20:53 2021 +0000 +++ b/tests/annotations-1.res Thu Apr 08 20:22:56 2021 +0300 @@ -1,8 +1,8 @@ ((topmost-intro <0,0>)) ((annotation-top-cont <1,0>)) ((annotation-top-cont <1,0>)) -((inclass <3,0>) (topmost-intro <1,0>)) -((class-close <4,0>)) +((inclass <1,0>) (topmost-intro <1,0>)) +((class-close <2,0>)) ((topmost-intro <1,0>)) ((topmost-intro <2,0>)) ((inclass <1,0>) (topmost-intro <1,0>))