The Mercury Project
[mercury-users] mtags, .int files and vim

Home

News

Information
  Overview
  Features
  Documentation
  Papers
  Developers
  Events
  Reports

Mailing Lists
  Developers
  Users
  Search

Download
  Current Release
  Snapshot
  Old Releases

Related
  Applications
  MCORBA
  Contributing Code

Contact

Search

Subject: [mercury-users] mtags, .int files and vim
From: John Eikenberry (jae@zhar.net)
Date: Sat Dec 16 2000 - 10:19:51 EST


There seems to be an incompatibility in the way mtags generates tag files
for the .int files... at least in respect to Vim.

For example, here's a line from random.int and the corresponding tags line
(generated via 'mtags --ext /usr/lib/mercury/ints/random.int'):

:- pred random:random(int, (random:supply), (random:supply)).

random:random /usr/lib/mercury/ints/random.int /^:- pred \
random:random(int, (random:supply), (random:supply)).$/;-;/random:random/

The problem is in the predicate name generated in the tags file. When the
tag name contains a colon like this, it is categorized by Vim as a 'static tag'
with the following format:

2. {tagfile}:{tagname} {TAB} {tagfile} {TAB} {tagaddress}

The restriction on this format is that the 2 occurances of the tagfile must be
exactly the same. As you can see, they are not. This causes Vim to fail in
finding the tag when trying to jump to it.

I'm fairly new to tags and very new to mercury, so I'm not positive, but it
seems like the way to correct this would be to strip the module name from the
tag name with mtags. Maybe adding something like...

        $name =~ s/[\w]+://;
        
to the output_name funtion near the beginning, right after the other $name
handling regex patterns.

BTW, this is using Mercury-0.9.1 on Debian GNU/Linux. I also looked at the
mtags in the snapshot releases, and they still had this 'problem'.

Thanks in advance for any feedback.

-- 

John Eikenberry [jae@zhar.net - http://zhar.net] ______________________________________________________________ "A society that will trade a little liberty for a little order will deserve neither and lose both." --B. Franklin -------------------------------------------------------------------------- mercury-users mailing list post: mercury-users@cs.mu.oz.au administrative address: owner-mercury-users@cs.mu.oz.au unsubscribe: Address: mercury-users-request@cs.mu.oz.au Message: unsubscribe subscribe: Address: mercury-users-request@cs.mu.oz.au Message: subscribe --------------------------------------------------------------------------



This mail archive was generated by hypermail 2b25 on Sun Dec 31 2000 - 00:40:04 EST.