GNU bug report logs -
#47408
Emacs etags support for Mercury [v0.2]
Previous Next
Reported by: fabrice nicol <fabrnicol <at> gmail.com>
Date: Fri, 26 Mar 2021 08:28:02 UTC
Severity: normal
Tags: patch
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #72 received at 47408 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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 <at> gmail.com,
>> 47408 <at> 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.
[univ.m (application/vnd.wolfram.mathematica.package, attachment)]
This bug report was last modified 3 years and 338 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.