From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel =?UTF-8?Q?G=C5=82owacki?= Newsgroups: gmane.emacs.bugs Subject: bug#72402: 28.2; Etags does not parse correctly Java source code Date: Mon, 19 Aug 2024 23:21:31 +0200 Message-ID: <87o75ous2s.fsf@hpg6> References: <87le1hr38a.fsf@hpg6> <86wml0wtcw.fsf@gnu.org> <875xsirir2.fsf@hpg6> <864j7i19ou.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25086"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cc: 72402@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 20 00:28:42 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1sgArh-0006I9-AS for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Aug 2024 00:28:41 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgArO-0002Le-OX; Mon, 19 Aug 2024 18:28:22 -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 1sgArN-0002LH-AR for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2024 18:28:21 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sgArN-0006QR-1m for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2024 18:28:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:In-Reply-To:Date:References:From:To:Subject; bh=ypm4szxoAcyFLHy8EiujHAcsgsps4EyuJfgW+rbDQWk=; b=RRxvsIimkpNlOBcbT7JCxO4yfrtu4gEFpRXC4PEk8P+97kAGSUs+DZmq7ZHp5Vxs7psqNIvE7TjvT8sbGBaTMHohq6A2BXyyWwm+HCLFTmipAB7nHjVb2XiyhWMc+beE+pgFDQfpmaHjnNn1fDTv78cM9NZUhv3B6jMQ8wxykRYlzJvMteQwoZ5t3QpwSUADdrAy/fpBH7o3GMu02PKhM76f25WsWqlVXQ2Mcjfh4Fx8XsYmlWcyZdVEZrsXO/ZqH1JUprc7jOTDOIvMW2A2GkZ8L1Ty8YI9Wn41dhB+1UlNuc9Oh0gmv5B4xrbLpXlgTLpvtc1dCQwiO1mAc0Ivxw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sgAs3-0002l2-7H for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2024 18:29:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel =?UTF-8?Q?G=C5=82owacki?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Aug 2024 22:29:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72402 X-GNU-PR-Package: emacs Original-Received: via spool by 72402-submit@debbugs.gnu.org id=B72402.172410648210507 (code B ref 72402); Mon, 19 Aug 2024 22:29:03 +0000 Original-Received: (at 72402) by debbugs.gnu.org; 19 Aug 2024 22:28:02 +0000 Original-Received: from localhost ([127.0.0.1]:59392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgAr3-0002j9-No for submit@debbugs.gnu.org; Mon, 19 Aug 2024 18:28:02 -0400 Original-Received: from mail-wr1-f47.google.com ([209.85.221.47]:59697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sg9qU-0000w2-Ot for 72402@debbugs.gnu.org; Mon, 19 Aug 2024 17:23:23 -0400 Original-Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-371b2e95c34so1307031f8f.3 for <72402@debbugs.gnu.org>; Mon, 19 Aug 2024 14:22:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724102494; x=1724707294; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=ypm4szxoAcyFLHy8EiujHAcsgsps4EyuJfgW+rbDQWk=; b=Cqolif/KDCDocbuaivdG51YoKGQq3sm3U4tUHRDJBwe8svQCnkTMroGXrBKKoe3S0g xcJDCN8gySnOxTp8Jv2OArovS+k54eizOniEy9gJqPQYk8ZMNhz5I0W90X0vbtbt3n91 rezvfhhGSC5bVaIkTa5zSvkYaObsPW4zLcVTsE7Bkzn4zu5mzD9MAH37GPtyl1prFfQ3 tz38ENS+znP3zGetprwLPz/IKgadpz7vSeAwS8MsIGYWTmmdqNQNz4YmRyOO4+lqn1Cz dOdzdbOme+1p7/X5jznlGuWguEGFN1ggmYpRaHcH9w0R9uHVhVTKaiZr2AdzjSfcbldS EbFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724102494; x=1724707294; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ypm4szxoAcyFLHy8EiujHAcsgsps4EyuJfgW+rbDQWk=; b=BPW0IEYssY4nwa22Op10lzSS/x9mRQqAAFTRg20YoNYk6Rm1eRRNaBoTTCeqzALx/+ IoUXuFVSF5nTtFGCaDSTKUkfZaVUTnoBqc66l4bcpbX4KzU9fxfGzfHDvhc+PlWZwDER RY91F8S8zNsKkbmaMt2nluY7oy6pJRFrWZcZz4ZWngc5cROyWNQotJcTcQH0yjA7UUx+ 0Jb8odq6A724XneSW2XES6T8F8Tna/8z+Xa4OV+LytjWeGWLQ54L0HJipWo0CSyq5GlV Y1bSx8AOQhCgAyqYQgKLwQsULVc97PO7HzUfuNjg76m2pUVG2vy+yW+TItx4JqMbdXuF FHpw== X-Gm-Message-State: AOJu0YzNjGdwGoowih6o6n56kBa64vkZoILr/LZ2yyoig8dbcXInJoGv fHPyg3HW6lsqdM8ehBccnAOUGy24lIIS9QsS3CuQ/o78TmqLRMUg02caog== X-Google-Smtp-Source: AGHT+IHZ5EKkaP9AdymeuVFILsH0Ly3kc2uKcRYdzlHQOX00NFMAIEkuHPRsAZqeZYtkcym5PPPuFg== X-Received: by 2002:adf:a396:0:b0:368:48b2:95ec with SMTP id ffacd0b85a97d-37194315c27mr7331196f8f.1.1724102493918; Mon, 19 Aug 2024 14:21:33 -0700 (PDT) Original-Received: from hpg6 (user-94-254-228-4.play-internet.pl. [94.254.228.4]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a83838cff50sm675487866b.63.2024.08.19.14.21.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2024 14:21:33 -0700 (PDT) In-Reply-To: <864j7i19ou.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 18 Aug 2024 12:06:57 +0300") X-Mailman-Approved-At: Mon, 19 Aug 2024 18:28:01 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290414 Archived-At: Hello, That's great news. Thank you very much for your support. Eli Zaretskii writes: > [Please use Reply All to reply, to keep the bug tracker CC'ed.] > >> From: Daniel G=C5=82owacki Date: Fri, 02 Aug 2024 >> 18:29:05 +0200 >>=20 >> Please take a look at the attachment. These are two Java classes >> from the same 'java.util' package and generated TAGS file. >>=20 >> ArrayList.java is parsed with 'class' keyword, however the >> HashMap.java does not have it. >>=20 >> This is only one example. I don't know how it works with a new Java >> keywords. > > Thanks. The problem was that etags became confused by the comma > inside Java class parameters, as in > > public class HashMap extends AbstractMap > > I fixed that. While at that, I saw that @SuppressWarnings is also not > supported, and causes the qualified identifier to be skipped, so I > fixed that as well. The patch for both these improvements is below, > in case you want to apply it locally; it is now installed on the > master branch of the Emacs Git repository (which will eventually > become Emacs 31). > > diff --git a/lib-src/etags.c b/lib-src/etags.c index edadbc2..4684ca8 > 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -2633,6 +2633,7 > @@ DEFUN, 0, st_C_gnumacro ENTRY, 0, st_C_gnumacro PSEUDO, 0, > st_C_gnumacro ENUM_BF, 0, st_C_enum_bf +@SuppressWarnings, (C_JAVA & > ~C_PLPL), st_C_attribute # These are defined inside C functions, so > currently they are not met. # EXFUN used in glibc, DEFVAR_* in emacs. > #EXFUN, 0, st_C_gnumacro @@ -2644,44 +2645,44 @@ DEFUN, 0, > st_C_gnumacro - make in_word_set static and not inline - remove any > 'register' qualifications from variable decls. */ /*%<*/ -/* C code > produced by gperf version 3.0.1 */ -/* Command-line: gperf -m 5 */ +/* > ANSI-C code produced by gperf version 3.1 */ +/* Command-line: gperf > -m 5 gperf.inp */ /* Computed positions: -k'2-3' */ >=20=20 > struct C_stab_entry { const char *name; int c_ext; enum sym_type > type; }; -/* maximum key range =3D 34, duplicates =3D 0 */ +/* maximum key > range =3D 36, duplicates =3D 0 */ >=20=20 > static int hash (const char *str, int len) { static char const > asso_values[] =3D { - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, > 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, > 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, > 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, > 36, 36, 36, 36, 36, 36, 36, 36, 3, - 27, 36, 36, 36, 36, 36, 36, 36, > 26, 36, - 36, 36, 36, 25, 0, 0, 36, 36, 36, 0, - 36, 36, 36, 36, 36, > 1, 36, 16, 36, 6, - 23, 0, 0, 36, 22, 0, 36, 36, 5, 0, - 0, 15, 1, 36, > 6, 36, 8, 19, 36, 16, - 4, 5, 36, 36, 36, 36, 36, 36, 36, 36, - 36, > 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, > 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, > 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - > 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, > 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, > 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, > - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, > 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36 + 38, 38, 38, 38, 38, 38, 38, > 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, > 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, > + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, > 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 29, + 3, 38, 38, > 38, 38, 38, 38, 38, 23, 38, + 38, 38, 38, 0, 5, 4, 38, 38, 38, 24, + > 38, 38, 38, 38, 38, 1, 38, 16, 38, 6, + 23, 0, 0, 38, 22, 0, 38, 38, > 5, 0, + 0, 15, 1, 38, 6, 38, 8, 19, 38, 16, + 4, 5, 38, 38, 38, 38, > 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, > 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, > 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, > 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, > 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, > 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, > 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + > 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38 }; > int hval =3D len; >=20=20 > @@ -2702,18 +2703,18 @@ in_word_set (const char *str, ptrdiff_t len) { > enum { - TOTAL_KEYWORDS =3D 34, + TOTAL_KEYWORDS =3D 35, MIN_WORD_LENGTH = =3D > 2, - MAX_WORD_LENGTH =3D 15, + MAX_WORD_LENGTH =3D 17, MIN_HASH_VALUE =3D= 2, > - MAX_HASH_VALUE =3D 35 + MAX_HASH_VALUE =3D 37 }; >=20=20 > static struct C_stab_entry wordlist[] =3D { {""}, {""}, {"if", 0, > st_C_ignore}, - {"GTY", 0, st_C_attribute}, + {""}, {"@end", 0, > st_C_objend}, {"union", 0, st_C_struct}, {"define", 0, st_C_define}, > @@ -2741,10 +2742,12 @@ in_word_set (const char *str, ptrdiff_t len) > {"undef", 0, st_C_define}, {"package", (C_JAVA & ~C_PLPL), > st_C_ignore}, {"__attribute__", 0, st_C_attribute}, - {"ENTRY", 0, > st_C_gnumacro}, {"SYSCALL", 0, st_C_gnumacro}, + {"GTY", 0, > st_C_attribute}, + {"ENTRY", 0, st_C_gnumacro}, {"ENUM_BF", 0, > st_C_enum_bf}, {"PSEUDO", 0, st_C_gnumacro}, + {"@SuppressWarnings", > (C_JAVA & ~C_PLPL), st_C_attribute}, {"DEFUN", 0, st_C_gnumacro} }; >=20=20 > @@ -3012,7 +3015,6 @@ consider_token (char *str, /* IN: token pointer > */ static ptrdiff_t structbracelev; static enum sym_type toktype; >=20=20 > - toktype =3D C_symtype (str, len, *c_extp); >=20=20 > /* @@ -4016,7 +4018,9 @@ C_entries (int c_ext, /* extension of C */ > default: fvdef =3D fvnone; } - if (structdef =3D=3D stagseen) + if > (structdef =3D=3D stagseen + /* class Foo... */ + && !(cjava && > templatelev > 0)) structdef =3D snone; break; case ']': --=20 Best regards, Daniel G=C5=82owacki