Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/smlnj-lib/PP/src/pp-desc-fn.sml
ViewVC logotype

Diff of /sml/trunk/src/smlnj-lib/PP/src/pp-desc-fn.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1829, Wed Jul 20 21:56:03 2005 UTC revision 1830, Sun Jul 24 00:41:21 2005 UTC
# Line 7  Line 7 
7   * (see pp-desc-sig.sml).   * (see pp-desc-sig.sml).
8   *)   *)
9    
10  functor PPDescFn (PPS : PP_STREAM) :> PP_DESC =  functor PPDescFn (PPS : PP_STREAM) : PP_DESC
11    struct    = struct
12    
13      structure PPS = PPS      structure PPS = PPS
14    
# Line 32  Line 32 
32        | Control of (PPS.device -> unit)        | Control of (PPS.device -> unit)
33    
34    (* pretty print a description *)    (* pretty print a description *)
35      fun description strm = let      fun description (strm, ppd) = let
36            fun pp (HBox l) = (PPS.openHBox strm; ppList l; PPS.closeBox strm)            fun pp (HBox l) = (PPS.openHBox strm; ppList l; PPS.closeBox strm)
37              | pp (VBox(i, l)) = (PPS.openVBox strm i; ppList l; PPS.closeBox strm)              | pp (VBox(i, l)) = (PPS.openVBox strm i; ppList l; PPS.closeBox strm)
38              | pp (HVBox(i, l)) = (PPS.openHVBox strm i; ppList l; PPS.closeBox strm)              | pp (HVBox(i, l)) = (PPS.openHVBox strm i; ppList l; PPS.closeBox strm)
# Line 49  Line 49 
49            and ppList [] = ()            and ppList [] = ()
50              | ppList (item::r) = (pp item; ppList r)              | ppList (item::r) = (pp item; ppList r)
51            in            in
52              pp              pp ppd
53            end            end
54    
55    (* exported PP description constructors *)    (* exported PP description constructors *)
# Line 65  Line 65 
65      fun space n = Break{nsp = n, offset = 0}      fun space n = Break{nsp = n, offset = 0}
66      val cut     = Break{nsp = 0, offset = 0}      val cut     = Break{nsp = 0, offset = 0}
67      val newline = NewLine      val newline = NewLine
68        val nbSpace = NBSpace
69      val control = Control      val control = Control
70    
71    end;    end;

Legend:
Removed from v.1829  
changed lines
  Added in v.1830

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0