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: Mon, 12 Apr 2021 20:33:39 +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="21657"; 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 Mon Apr 12 19:36:02 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 1lW0Tg-0005TO-RF for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Apr 2021 19:36:00 +0200 Original-Received: from localhost ([::1]:35496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lW0Tf-0005KZ-PB for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Apr 2021 13:35:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lW0RY-0004NA-Q4 for emacs-devel@gnu.org; Mon, 12 Apr 2021 13:33:48 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:38407) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lW0RW-00049p-W8 for emacs-devel@gnu.org; Mon, 12 Apr 2021 13:33:48 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id DD6ED5C01DC; Mon, 12 Apr 2021 13:33:44 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 12 Apr 2021 13:33:44 -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=vh/rz2nHjYPK6l1qdMtnU5Wddr wRJSqu8zDVFendLRk=; b=kFx2o4tpn7ZG8BlrubYiQGmgvCynfHZqLFZONNqPtV bCFudtCOrE1TvzL61aYArdST9ywF7s8/IegDEt9d756d37cpOimb5UUireWKO8Em 8yCZMqag2VmNmlzwmpdijnD6i1gi7wx1xI+nB9i09s1c+bFREhDfM7hDHw+2YGzk DdK4aYiQDWnNIJSpIb6kwpjMdnc078NiPnUf22JycCw8Haagtj5sbVAHPzGFwxo4 2aB1ZawHhLKYtzxSNIu8nabPSsZhWMY0C7wwwhLlx5a7dchyMPqYMll2M5fce5nJ DSNz2lrm3wWIcdwhvNS8626lLvp51GDohlK0PSAGR/AA== 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=vh/rz2 nHjYPK6l1qdMtnU5WddrwRJSqu8zDVFendLRk=; b=m3nTh5KUR7K27PYiKI5VGD mJTqTtRIw9OAe/EA0d0pxRUk5CQ7yfA8kJB6Y+OP/fKg1h0SxKvA+QnnRezMvf3S 1bvuGWskZH83eDs1E/vRQ7fCzsGS71ZORNVs759UBh+lMg/m/lm4QwSoQKE8/YkV BSS9xzKKyzcRMJ2Sc7HIjkVpS/hB8XW+5z1o7vgPYb9N+vZ7XsUJqapIsedYuU0o yafOs6EtGtLsXNHbgd7f295lLQWN0UkieAuRF0RpIngsSWLi6LL4qbVMhn05ghaZ JgOJYDcGNu9F+Pt5bdS+jj6hYZRfWmjyu7LPv/p3O59OpPg+oIDS6RB1NtsTt8Aw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudekjedgudduhecutefuodetggdotefrod 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 AE617240065; Mon, 12 Apr 2021 13:33:43 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Mon, 12 Apr 2021 13:36:07 +0000") Mail-Followup-To: Alan Mackenzie , emacs-devel@gnu.org Received-SPF: pass client-ip=66.111.4.27; envelope-from=fgunbin@fastmail.fm; helo=out3-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:267971 Archived-At: Hi Alan, On 12/04/2021 13:36 +0000, Alan Mackenzie wrote: > I've had a more thorough look at it. In cc-langs.el, there are several > places where @ is treated as a symbol character, namely: I've checked those places before submitting the patch, and I think they should stay without change. > L375: c-make-mode-syntax-table (which you have proposed modifying) > L419: c-identifier-syntax-modifications > L636: c-symbol-start I see no problem in leaving them as-is, because they will just continue to match @ with the following chars as a whole. It's just when you need more fine-grained distinction, then you could check if it's prefix or symbol. Prefix syntax is defined so that prefix chars are part of the following expression, that's exactly the case of Java annotations. > L1969: c-paragraph-start (I think this one only applies in comments) Yes, this is for javadoc tags, which start with @, and appear only in comments, like: /** * @param my-param .. */ > L2198: c-class-decl-kwds (The "@interface" keyword) @interface is a keyword which declares the annotation interface itself. I would really hope that syntax tables do not affect parsing/matching of keywords. If they don't, then this place doesn't need to be changed, either. > We need to consider whether to amend some or all of these places, so > that @ ceases to be a (starting) character of an identifier. I don't think it should cease to be. > I'm also a bit worried that in > > @NonNull > @TestClass > @FooBar > public class Annotations { > > , the last line gets parsed as ((annotation-top-cont 21)), where it > really ought to be a topmost-intro. But this problem is present without > your patch, anyway. > > In summary, I think the motivation for the change (highlighting symbols > correctly) is valid, but the change is going to be more involved than > the patch you've supplied. It's not about highlighting, but rather about "extracting" @, to be able to request the non-@ part separately. But maybe I'm missing something. Thanks. Filipp