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 /sml/trunk/src/compiler/Basics/print/printcontrol.sml
ViewVC logotype

Annotation of /sml/trunk/src/compiler/Basics/print/printcontrol.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1145 - (view) (download)

1 : blume 902 (* printcontrol.sml
2 :     *
3 :     * (C) 2001 Lucent Technologies, Bell Labs
4 :     *)
5 :     signature PRINTCONTROL = sig
6 :     val printDepth : int ref
7 :     val printLength : int ref
8 :     val stringDepth : int ref
9 :     val printLoop : bool ref
10 :     val signatures : int ref
11 :     val printOpens : bool ref
12 :     val out : {say : string -> unit, flush : unit -> unit} ref
13 :     val linewidth : int ref
14 :     val say : string -> unit
15 :     val flush: unit -> unit
16 :     end
17 :    
18 :     structure Control_Print : PRINTCONTROL = struct
19 : blume 1126
20 : blume 1145 val m = Controls.registry { name = "compiler print settings",
21 :     priority = [10, 10, 2],
22 :     obscurity = 2,
23 :     prefix = "print-",
24 :     default_suffix = SOME "-default",
25 :     mk_ename = NONE }
26 : blume 1126
27 : blume 1145 val flag_r = Controls.group m Controls.bool
28 : blume 1126
29 : blume 1145 val int_r = Controls.group m Controls.int
30 : blume 1126
31 : blume 1145 fun new (r, s, d, f) = Controls.new r { stem = s, descr = d, fallback = f }
32 : blume 1126
33 :     val printDepth = new (int_r, "depth", "max print depth", 5)
34 :     val printLength = new (int_r, "length", "max print length", 12)
35 :     val stringDepth = new (int_r, "string-depth", "max string print depth", 70)
36 :     val printLoop =
37 :     new (flag_r, "loop", "print loop", true) (* ? *)
38 :     val signatures =
39 :     new (int_r, "signatures", "max signature expansion depth", 2) (* ? *)
40 :     val printOpens = new (flag_r, "opens", "print `open'", true)
41 : blume 902 val out = ref{
42 :     say = fn s => TextIO.output(TextIO.stdOut,s),
43 :     flush = fn () => TextIO.flushOut TextIO.stdOut
44 :     }
45 : blume 1126 val linewidth = new (int_r, "linewidth",
46 :     "line-width hint for pretty printer", 79)
47 : blume 902 fun say s = #say (!out) s
48 :     fun flush() = #flush (!out) ()
49 :     end

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