for review: tests for mdmangle

Thomas Charles CONWAY conway at cs.mu.oz.au
Wed Aug 27 15:01:35 AEST 1997


Here's a couple of tests for the demangling of lambda goal names.

-- 
ZZ:wq!
^X^C
Thomas Conway               				      conway at cs.mu.oz.au
AD DEUM ET VINUM	  			      Every sword has two edges.


tests/misc_tests/mdmangle.{inp,exp}:
	add a couple of tests for the mangling of lambda goal names

utils/mdemangle.c:
	bugfix to previous change.

cvs diff: Diffing .
Index: mdemangle_test.exp
===================================================================
RCS file: /home/staff/zs/imp/tests/misc_tests/mdemangle_test.exp,v
retrieving revision 1.6
diff -u -r1.6 mdemangle_test.exp
--- mdemangle_test.exp	1997/07/26 11:45:05	1.6
+++ mdemangle_test.exp	1997/08/27 04:57:45
@@ -84,3 +84,6 @@
 mercury_data_foo
 mercury_data_foo
 
+	some lambda goals
+<pred goal from 'simplex' line 262 label 5>
+<func goal from 'collect_vars' line 153>
Index: mdemangle_test.inp
===================================================================
RCS file: /home/staff/zs/imp/tests/misc_tests/mdemangle_test.inp,v
retrieving revision 1.6
diff -u -r1.6 mdemangle_test.inp
--- mdemangle_test.inp	1997/07/26 11:45:06	1.6
+++ mdemangle_test.inp	1997/08/27 03:37:50
@@ -84,3 +84,6 @@
 mercury_data_foo
 mercury_data_foo
 
+	some lambda goals
+mercury__lp__IntroducedFrom__pred__simplex__262__9_7_0_i5
+mercury__lp__IntroducedFrom__func__collect_vars__153__4_3_0
cvs diff: Diffing .
Index: mdemangle.c
===================================================================
RCS file: /home/staff/zs/imp/mercury/util/mdemangle.c,v
retrieving revision 1.21
diff -u -r1.21 mdemangle.c
--- mdemangle.c	1997/08/27 03:36:04	1.21
+++ mdemangle.c	1997/08/27 04:56:50
@@ -291,7 +291,14 @@
 		}
 	}
 
-	if (category == ORDINARY && strip_prefix(&start, introduced)) {
+	/*
+	** chop off the module name,
+	** look for "IntroducedFrom"
+	*/
+	position = start;
+	if (category == ORDINARY
+			&& cut_at_double_underscore(&start, end)
+			&& strip_prefix(&start, introduced)) {
 		category = LAMBDA;
 		if (strip_prefix(&start, pred)) {
 			lambda_kind = "pred";
@@ -309,6 +316,8 @@
 			lambda_line = lambda_line * 10 + (*start - '0');
 			start++;
 		}
+	} else {
+		start = position;
 	}
 
 			



More information about the developers mailing list