bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#47408: Etags support for Mercury [v0.5]


From: fabrice nicol
Subject: bug#47408: Etags support for Mercury [v0.5]
Date: Thu, 10 Jun 2021 18:52:49 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2

Eli,

your latest fix for Mercury 'etags' support has introduced a regression for existentially quantified predicates.

These predicates have the following (somewhat simplified) syntax (in extended regexp  form, \s for white space):

:-[:blank:]+some[:blank:]*\[[:blank:]*T(,[:blank:]*[:upper:]{1})*[:blank:]*\][:blank:]+pred[:blank:]+([:lower:]+([:alnum:]|[:punct:])*)+[:blank:]*\([^()]+\)([:blank:]|[:lower:])*\.

Example:

:- some [T] pred unravel_univ(univ::in, T::out) is det.

Your fix incorrectly outputs such quantified predicates. For example on tagging univ.m (attached), your commit version yields:


:- some [T] pred unravel_univ(^?[T] pred unravel_univ^A141,4333


whilst my original code yields the correct tag:


:- some [T] pred unravel_univ(^?141,4333


In other words, 'pred unravel_univ' is wrongly repeated in your latest commit.

The issue seems to be located at the patch line below:


+ char *name = skip_non_spaces (s + len0);


Pending a more accurate 'fix for the fix', it would probably be wiser to revert to original code, as it - at least - gives a correct output for 'etags' invocation.

Existentially quantified predicates are not uncommon in Mercury.

Fabrice

Date: Tue, 08 Jun 2021 14:47:13 +0200
Cc: fabrnicol@gmail.com,
        47408@debbugs.gnu.org

I just looked at the code.  Unless I am grossly mistaken, nothing is
needed to get ctags output.  You just call the program as ctags and
that's it.  So there is no reason to prevent ctags help from mentioning
Mercurial.
Then how come, when I run the etags test suite (test/manual/etags/), I
get no change in the produced CTAGS file wrt CTAGS.good?  That .good
file is from before we added the Mercury source to the suite.  What am
I missing?
Sorry, don't know :(  Looked again, but then I'd need to debug it to know...
I found the reason: make_tag was called incorrectly from mercury_pr.

This should be fixed now.

Attachment: univ.m
Description: application/vnd.wolfram.mathematica.package


reply via email to

[Prev in Thread] Current Thread [Next in Thread]