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 10 - (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 :     include PP_STREAM val dump : (TextIO.outstream * stream) -> unit
11 :     end) : sig
12 :     include PP_STREAM
13 :     val debugStrm : TextIO.outstream ref
14 :     end = struct
15 :    
16 :     type device = PP.device
17 :     type stream = PP.stream
18 :     type token = PP.token
19 :     type style = PP.style
20 :     datatype indent = datatype PP.indent
21 :    
22 :     val debugStrm = ref TextIO.stdErr
23 :    
24 :     fun debug name f strm arg = (
25 :     TextIO.output(!debugStrm, concat["*** ", name, ": "]);
26 :     PP.dump (!debugStrm, strm);
27 :     TextIO.flushOut(!debugStrm);
28 :     f strm arg)
29 :     fun debug' name f strm = (
30 :     TextIO.output(!debugStrm, concat["*** ", name, ": "]);
31 :     PP.dump (!debugStrm, strm);
32 :     TextIO.flushOut(!debugStrm);
33 :     f strm)
34 :    
35 :     val openStream = PP.openStream
36 :     val flushStream = debug' "flushStream" PP.flushStream
37 :     val closeStream = debug' "closeStream" PP.closeStream
38 :    
39 :     val openHBox = debug' "openHBox" PP.openHBox
40 :     val openVBox = debug "openVBox" PP.openVBox
41 :     val openHVBox = debug "openHVBox" PP.openHVBox
42 :     val openHOVBox = debug "openHOVBox" PP.openHOVBox
43 :     val openBox = debug "openBox" PP.openBox
44 :     val closeBox = debug' "closeBox" PP.closeBox
45 :    
46 :     val token = debug "token" PP.token
47 :     val string = debug "string" PP.string
48 :    
49 :     val pushStyle = PP.pushStyle
50 :     val popStyle = PP.popStyle
51 :    
52 :     val break = debug "break" PP.break
53 :     val space = debug "space" PP.space
54 :     val cut = debug' "cut" PP.cut
55 :     val newline = debug' "newline" PP.newline
56 :     val nbSpace = debug "nbSpace" PP.nbSpace
57 :     val onNewline = debug "onNewline" PP.onNewline
58 :    
59 :     end;
60 :    

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