xref: /original-bsd/usr.bin/pascal/pxp/cset.c (revision 655593d0)
1 /*-
2  * Copyright (c) 1980 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)cset.c	5.2 (Berkeley) 04/16/91";
10 #endif /* not lint */
11 
12 /*
13  * pxp - Pascal execution profiler
14  *
15  * Bill Joy UCB
16  * Version 1.2 January 1979
17  */
18 
19 #include "0.h"
20 #include "tree.h"
21 
22 /*
23  * Constant sets
24  */
25 cset(r)
26 int *r;
27 {
28 	register *e, *el;
29 
30 	ppbra("[");
31 	el = r[2];
32 	if (el != NIL)
33 		for (;;) {
34 			e = el[1];
35 			el = el[2];
36 			if (e == NIL)
37 				continue;
38 			if (e[0] == T_RANG) {
39 				rvalue(e[1], NIL);
40 				ppsep("..");
41 				rvalue(e[2], NIL);
42 			} else
43 				rvalue(e, NIL);
44 			if (el == NIL)
45 				break;
46 			ppsep(", ");
47 		}
48 	ppket("]");
49 }
50