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 2980 - (view) (download)

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

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