unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: emacs-devel@gnu.org
Subject: Re: RFR cc-langs.el: change syntax for @ in Java
Date: Thu, 8 Apr 2021 09:29:10 +0000	[thread overview]
Message-ID: <YG7M5imFzk2JX8wX@ACM> (raw)
In-Reply-To: <m2a6q9omje.fsf@fastmail.fm>

Hello, Fillip.

On Wed, Apr 07, 2021 at 23:41:09 +0300, Filipp Gunbin wrote:
> Hi Alan, are you ok if I make this small change?  Prefix is better
> syntax for @ in Java, because it just denotes that the following is
> an annotation interface name (but is not part of it).

Do you have a specific test case where things go wrong at the moment, or
work better with the change in place?

I'll run the CC Mode test suite with this change to see how it goes.  It
might entail changes to functions like c-forward-decl-or-cast-1.

> Thanks.
> Filipp

> diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
> index fa4e73087e..e2c1c6099f 100644
> --- a/lisp/progmodes/cc-langs.el
> +++ b/lisp/progmodes/cc-langs.el
> @@ -378,12 +378,14 @@ c-make-mode-syntax-table
>         (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)))

-- 
Alan Mackenzie (Nuremberg, Germany).



  reply	other threads:[~2021-04-08  9:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07 20:41 RFR cc-langs.el: change syntax for @ in Java Filipp Gunbin
2021-04-08  9:29 ` Alan Mackenzie [this message]
2021-04-08 10:15 ` Alan Mackenzie
2021-04-08 11:31   ` Filipp Gunbin
2021-04-08 17:26   ` Filipp Gunbin
2021-04-12 13:36     ` Alan Mackenzie
2021-04-12 17:33       ` Filipp Gunbin
2021-04-13 10:28         ` Alan Mackenzie
2021-04-13 14:45           ` Filipp Gunbin
2021-04-14 19:55             ` Alan Mackenzie
2021-04-14 21:31               ` Ergus
2021-04-15 14:42               ` Filipp Gunbin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YG7M5imFzk2JX8wX@ACM \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).