CVS: sml-dist/src/compiler/Elaborator/print ppprim.sml, NONE, 1.1.2.1

George Kuan <[email protected]> Mon, 31 Jul 2006 16:29:48 -0700
Newsgroups gmane.comp.lang.sml.smlnj.commits
Message-ID <[email protected]>
Update of /cvsroot/smlnj/sml-dist/src/compiler/Elaborator/print
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv16310/src/compiler/Elaborator/print

Added Files:
      Tag: primop-branch-2
	ppprim.sml 
Log Message:
pp for prim, transtype IBOUND case a bug

--- NEW FILE: ppprim.sml ---
structure PPPrim =
struct

local 
    open PPUtilNew 
in

fun ppPrim ppstrm prim =
    let val {pps, ...} = ppstrm
    in (case prim of 
	    PrimOpId.NonPrim => pps "<NonPrim>"
	  | PrimOpId.Prim(name) => (pps "<PrimE ";
				     pps name;
				     pps ">"))
    end (* function ppPrim *)

fun ppStrPrimInfo ppstrm strPrimInfo =
    let val {openHOVBox, pps, ...} = ppstrm
	fun ppStrPrimElem ppstrm (PrimE p) = ppPrim ppstrm p
	  | ppStrPrimElem ppstrm (StrE ps) = ppStrPrimInfo ppstrm ps
    in
	ppSequence ppstrm 
		   {sep = fn ppstrm => (PP.string ppstrm ", ";
					PP.break ppstrm {nsp=1, offset=0}),
		    pr = (fn _ => fn elem => 
				     (openHOVBox 1; 
				      pps "(";
				      ppStrPrimElem ppstrm,
				      pps ")";
				      closeBox()))
		    style = INCONSISTENT
		    }
		   strPrimInfo
    end (* function ppStrPrimInfo *)
end (* local *)

end


-------------------------------------------------------------------------
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