From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#47408: Etags support for Mercury [v0.5] Date: Thu, 10 Jun 2021 22:15:11 +0300 Message-ID: <838s3hbkg0.fsf@gnu.org> References: <70503251-f8ea-9006-b7e7-b13b93bb71de@gmail.com> <838s4gxurw.fsf@gnu.org> <53162dfb-0715-3077-78d1-3a8340943f2f@gmail.com> <838s3y6kaq.fsf@gnu.org> <83k0n7iarj.fsf@gnu.org> <65f059b1-149d-146d-3b8d-36db60ff1044@gmail.com> <87o8cin9fb.fsf@tucano.isti.cnr.it> <39f683d3-65d7-a7d9-18b1-cf6dfa7d254a@gmail.com> <83fsxthnye.fsf@gnu.org> <87lf7kmxuk.fsf@tucano.isti.cnr.it> <83bl8gfuhy.fsf@gnu.org> <87k0n4msku.fsf@tucano.isti.cnr.it> <834ke5ddnb.fsf@gnu.org> <83h7i5bpqq.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16233"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 47408@debbugs.gnu.org To: fabrnicol@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 10 21:16:10 2021 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 1lrQ9y-000404-Qn for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Jun 2021 21:16:10 +0200 Original-Received: from localhost ([::1]:51476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrQ9x-0004lo-4y for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Jun 2021 15:16:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrQ9q-0004lZ-I6 for bug-gnu-emacs@gnu.org; Thu, 10 Jun 2021 15:16:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54401) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lrQ9q-0001ze-A7 for bug-gnu-emacs@gnu.org; Thu, 10 Jun 2021 15:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lrQ9q-0000dw-2E for bug-gnu-emacs@gnu.org; Thu, 10 Jun 2021 15:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Jun 2021 19:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47408 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 47408-submit@debbugs.gnu.org id=B47408.16233525372440 (code B ref 47408); Thu, 10 Jun 2021 19:16:02 +0000 Original-Received: (at 47408) by debbugs.gnu.org; 10 Jun 2021 19:15:37 +0000 Original-Received: from localhost ([127.0.0.1]:37714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrQ9Q-0000dI-UM for submit@debbugs.gnu.org; Thu, 10 Jun 2021 15:15:37 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrQ9L-0000cz-M6 for 47408@debbugs.gnu.org; Thu, 10 Jun 2021 15:15:35 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:34768) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrQ9G-0001aw-6c; Thu, 10 Jun 2021 15:15:26 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3210 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrQ9E-0005dj-JQ; Thu, 10 Jun 2021 15:15:26 -0400 In-Reply-To: <83h7i5bpqq.fsf@gnu.org> (message from Eli Zaretskii on Thu, 10 Jun 2021 20:20:45 +0300) 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" Xref: news.gmane.io gmane.emacs.bugs:208334 Archived-At: > Date: Thu, 10 Jun 2021 20:20:45 +0300 > From: Eli Zaretskii > Cc: 47408@debbugs.gnu.org > > It should have been the job of mercury_pr to find the identifier > itself within the line whose pointer it accepts as S, and pass only > that to make_tag as NAME/NAMELEN arguments. I made a step in that > direction, but it turns out I didn't go far enough. Feel free to > propose improvements to the code I installed so as to identify the > name of the identifier and nothing else, as other callers of make_tag > do. > > > The issue seems to be located at the patch line below: > > > > > > + char *name = skip_non_spaces (s + len0); > > The only problem with the above line is that it assumes there's only > one non-space "word" before the identifier proper, whereas the example > you show makes it clear there could be more than one. Which means the > code might need to repeatedly skip these non-identifier words until we > exhaust them all. I will look into fixing that (but I really prefer > that you do it in my stead, as I don't know enough about the Mercury's > syntax). I think one way of solving this would be for mercury_decl to return more information to the caller than it currently does. That function already performs the necessary analysis of the line, and knows where the real identifier is located within that line. But it doesn't return that information to the caller. If it could return the pointer to the beginning of the identifier and the length of the identifier, it would allow mercury_pr to call make_tag correctly without doing again what mercury_decl already did. If you agree with this analysis, I'd be grateful if you could submit a patch along these lines. TIA.