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

SCM Repository

[smlnj] Annotation of /smlnj-lib/branches/rt-transition/PP/src/pp-debug-fn.sml
ViewVC logotype

Annotation of /smlnj-lib/branches/rt-transition/PP/src/pp-debug-fn.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 411 - (view) (download)
Original Path: sml/branches/SMLNJ/src/smlnj-lib/PP/src/pp-debug-fn.sml

1 : monnier 7 (* pp-debug-fn.sml
2 :     *
3 :     * COPYRIGHT (c) 1997 Bell Labs, Lucent Technologies.
4 :     *
5 :     * A wrapper for the PPStreamFn, which dumps the current PP state prior
6 :     * to each operation.
7 :     *)
8 :    
9 :     functor PPDebugFn (PP : sig
10 : monnier 411 include PP_STREAM
11 :     val dump : (TextIO.outstream * stream) -> unit
12 : monnier 7 end) : sig
13 :     include PP_STREAM
14 :     val debugStrm : TextIO.outstream ref
15 :     end = struct
16 :    
17 :     type device = PP.device
18 :     type stream = PP.stream
19 :     type token = PP.token
20 :     type style = PP.style
21 :     datatype indent = datatype PP.indent
22 :    
23 :     val debugStrm = ref TextIO.stdErr
24 :    
25 :     fun debug name f strm arg = (
26 :     TextIO.output(!debugStrm, concat["*** ", name, ": "]);
27 :     PP.dump (!debugStrm, strm);
28 :     TextIO.flushOut(!debugStrm);
29 :     f strm arg)
30 :     fun debug' name f strm = (
31 :     TextIO.output(!debugStrm, concat["*** ", name, ": "]);
32 :     PP.dump (!debugStrm, strm);
33 :     TextIO.flushOut(!debugStrm);
34 :     f strm)
35 :    
36 :     val openStream = PP.openStream
37 :     val flushStream = debug' "flushStream" PP.flushStream
38 :     val closeStream = debug' "closeStream" PP.closeStream
39 :    
40 :     val openHBox = debug' "openHBox" PP.openHBox
41 :     val openVBox = debug "openVBox" PP.openVBox
42 :     val openHVBox = debug "openHVBox" PP.openHVBox
43 :     val openHOVBox = debug "openHOVBox" PP.openHOVBox
44 :     val openBox = debug "openBox" PP.openBox
45 :     val closeBox = debug' "closeBox" PP.closeBox
46 :    
47 :     val token = debug "token" PP.token
48 :     val string = debug "string" PP.string
49 :    
50 :     val pushStyle = PP.pushStyle
51 :     val popStyle = PP.popStyle
52 :    
53 :     val break = debug "break" PP.break
54 :     val space = debug "space" PP.space
55 :     val cut = debug' "cut" PP.cut
56 :     val newline = debug' "newline" PP.newline
57 :     val nbSpace = debug "nbSpace" PP.nbSpace
58 :     val onNewline = debug "onNewline" PP.onNewline
59 : monnier 289 val control = debug "control" PP.control
60 : monnier 7
61 : monnier 411 type pp_desc = PP.pp_desc
62 :     val description = debug "description" PP.description
63 :    
64 :     structure Desc = PP.Desc
65 :    
66 : monnier 7 end;
67 :    

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