[m-rev.] for review: minor change to mtags

David Overton dmo at cs.mu.OZ.AU
Fri Jul 6 00:09:55 AEST 2001


On Thu, Jul 05, 2001 at 11:25:20PM +1000, Fergus Henderson wrote:
> Estimated hours taken: 0.5
> Branches: main
> 
> scripts/mtags:
> 	When searching for the clauses that match a given predicate
> 	declaration, assume that the clause has the same number of
> 	module qualifiers as the declaration.  This is more likely to be
> 	correct than always assuming that the clause has the same
> 	number of qualifiers as the call, which is what we did previously.

This looks fine.  Thanks Fergus.

> 	
> 	(The ideal thing to do here would be to search for clauses with
> 	any number of qualifiers, but that is tricky to do right, because
> 	the right operator to use for disjunction in the search pattern
> 	varies depending on the exact vim options set; it could be either
> 	"|" or "\|".)

Are you referring to the 'magic' option?  If so, according to the Vim
documentation, this option does not affect the disjunction operator --
you should use '\|' regardless of whether 'magic' is set or not.

> 
> Workspace: /home/hg/fjh/ws-hg4/mercury
> Index: scripts/mtags
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/scripts/mtags,v
> retrieving revision 1.27
> diff -u -d -r1.27 mtags
> --- scripts/mtags	2000/12/11 10:43:11	1.27
> +++ scripts/mtags	2001/07/05 13:12:38
> @@ -242,6 +242,9 @@
>  	$match_line =~ s|\\|\\\\|g;   # replace `\' with `\\'
>  	$match_line =~ s|/|\\/|g;     # replace `/' with `\/'
>  
> +	# $src_name holds the name as it was in the original source
> +	$src_name = $name;
> +
>  	# output a tag for the fully-qualified name
>  	if (substr($name, 0, length($module)) ne $module) {
>  		$name = "${module}__$name";
> @@ -281,7 +284,7 @@
>  		# Output commands to alter the search buffer.
>  		if ($search_definitions) {
>  		    if ($kind eq "pred" || $kind eq "func") {
> -			printf out ";kq|/^\\<%s\\>/;'q", $name;
> +			printf out ";kq|/^\\<%s\\>/;'q", $src_name;
>  		    } else {
>  			printf out ";kq|-;/\\<%s\\>/;'q", $name;
>  		    }
> 
> -- 
> Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
> The University of Melbourne         |  of excellence is a lethal habit"
> WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
> --------------------------------------------------------------------------
> mercury-reviews mailing list
> post:  mercury-reviews at cs.mu.oz.au
> administrative address: owner-mercury-reviews at cs.mu.oz.au
> unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
> subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
> --------------------------------------------------------------------------

-- 
David Overton      Department of Computer Science & Software Engineering
PhD Student        The University of Melbourne, Victoria 3010, Australia
+61 3 8344 9159    http://www.cs.mu.oz.au/~dmo
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list