for review: allow mtags to handle `impure' and `semipure' declarations

David Matthew Overton dmo at cs.mu.OZ.AU
Mon Aug 10 16:40:19 AEST 1998


On Tue, Aug 04, 1998 at 09:41:19PM EST, Fergus Henderson wrote:
> mtags doesn't handle pred declarations with `impure', e.g.
> table_lookup_insert_int.
> 
Since Fergus isn't around, would someone else like to review this
change?

Estimated hours taken: 0.5

scripts/mtags:
	Strip `impure' and `semipure' from predicate and function
	declarations.

	Fix a comment.

Index: mtags
===================================================================
RCS file: /home/staff/zs/imp/mercury/scripts/mtags,v
retrieving revision 1.17
diff -u -r1.17 mtags
--- 1.17	1998/07/13 00:59:22
+++ mtags	1998/08/10 06:27:33
@@ -185,9 +185,9 @@
 		    # `nomagic' mode.
 		    $match_line =~ s/\[/\\\[/g;
 
-		    # Elvis allows only a single search pattern or line number
-		    # rather than an arbitrary sequence of colon-separated ex
-		    # commands.
+		    # Elvis allows only a single search pattern or line
+		    # number rather than an arbitrary sequence of
+		    # semicolon-separated ex commands.
 		    printf out "%s\t%s\t/^%s\$/;\"\tkind:%s%s%s\n",
 			$name, $file, $match_line, $kind, $static, $sfile;
 		} else {
@@ -264,6 +264,12 @@
 	($cmd, $decl, @rest) = split;
 	$body = join(' ', @rest);
 
+	# Remove `impure' and `semipure' declarations.
+	if ($decl eq "impure" || $decl eq "semipure") {
+		($decl, @rest) = split /\s+/, $body;
+		$body = join(' ', @rest);
+	}
+
 	# Is this an "interface" or "implementation" declaration?
 	# If so, change context.
 	if ($decl =~ "\binterface\b" || $decl =~ "\bimplementation\b") {
-- 
David Overton
MEngSc Student                       Email: dmo at cs.mu.oz.au     
Department of Computer Science       Web: http://www.cs.mu.oz.au/~dmo
The University of Melbourne          Phone: +61 3 9344 9159



More information about the developers mailing list