CVS: sml-dist/src/compiler/FLINT/kernel pplty.sml, 1.1.2.5, 1.1.2.6

George Kuan <[email protected]> Thu, 03 Aug 2006 11:10:28 -0700
Newsgroups gmane.comp.lang.sml.smlnj.commits
Message-ID <[email protected]>
Update of /cvsroot/smlnj/sml-dist/src/compiler/FLINT/kernel
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4002/src/compiler/FLINT/kernel

Modified Files:
      Tag: primop-branch-2
	pplty.sml 
Log Message:
pplty updated to pretty priint rectycs more sensibly

Index: pplty.sml
===================================================================
RCS file: /cvsroot/smlnj/sml-dist/src/compiler/FLINT/kernel/Attic/pplty.sml,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -C2 -d -r1.1.2.5 -r1.1.2.6
*** pplty.sml	31 Jul 2006 23:29:46 -0000	1.1.2.5
--- pplty.sml	3 Aug 2006 18:10:26 -0000	1.1.2.6
***************
*** 153,161 ****
  	     ppList' {sep=", ", pp=ppTyc'} tycs;
  	     pps ")")
! 	    (* TC_FIX is a recursive DATATYPE *)
  	  | ppTycI (LK.TC_FIX((numStamps, datatypeFamily, freetycs), index)) =
  	    (openHOVBox 1;
  	     pps "TC_FIX(";
  	     PP.break ppstrm {nsp=1,offset=1};
  	     pps "nStamps = ";
  	     pps (Int.toString numStamps);
--- 153,190 ----
  	     ppList' {sep=", ", pp=ppTyc'} tycs;
  	     pps ")")
! 	    (* TC_FIX is a recursive datatype constructor 
! 	       from a (mutually-)recursive family *)
  	  | ppTycI (LK.TC_FIX((numStamps, datatypeFamily, freetycs), index)) =
  	    (openHOVBox 1;
  	     pps "TC_FIX(";
  	     PP.break ppstrm {nsp=1,offset=1};
+ 	     (case (LK.tc_out datatypeFamily) of
+ 		  LK.TC_FN(params, rectyc) => (* generator function *) 
+ 		  let fun ppMus 0 = ()
+ 			| ppMus i = (pps "mu"; 
+ 				     ppi ppstrm i; 
+ 				     pps " "; 
+ 				     ppMus (i - 1))
+ 		  in 
+ 		  (pps "RECTYCGEN(";
+ 		   if (length params) > 0 then (pps "[";
+ 						ppMus (length params);
+ 						pps "]")
+ 		   else ();
+ 		   PP.break ppstrm {nsp=1,offset=1};  
+ 		  (case (LK.tc_out rectyc) of
+ 			 (rectycI as LK.TC_FN _) => ppTycI rectycI
+ 		       | LK.TC_SEQ(dconstycs) => 
+ 			 ppTyc' (List.nth(dconstycs, index))
+ 		       | tycI => ppTycI tycI);
+ 		  PP.break ppstrm {nsp=0,offset=0};
+ 		  pps ")")
+ 		  end
+ 		| _ => pps "<No rectyc generator>");
+ 	     PP.break ppstrm {nsp=0,offset=0};
+ 	     pps ")";
+ 	     closeBox()
+ 	 (*    pps "TC_FIX(";
+ 	     PP.break ppstrm {nsp=1,offset=1};
  	     pps "nStamps = ";
  	     pps (Int.toString numStamps);
***************
*** 173,177 ****
  	     pps (Int.toString index);
  	     pps ")";
! 	     closeBox())
  	  | ppTycI (LK.TC_ABS tyc) =
  	    (pps "TC_ABS(";
--- 202,206 ----
  	     pps (Int.toString index);
  	     pps ")";
! 	     closeBox() *) )
  	  | ppTycI (LK.TC_ABS tyc) =
  	    (pps "TC_ABS(";


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV