File: elabcontrol.sml

package info (click to toggle)
smlnj 110.79-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 82,552 kB
  • sloc: ansic: 32,532; asm: 6,314; sh: 2,303; makefile: 1,821; perl: 1,170; pascal: 295; yacc: 190; cs: 78; python: 77; lisp: 19
file content (91 lines) | stat: -rw-r--r-- 2,905 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
(* elabcontrol.sml
 *
 * (C) 2001 Lucent Technologies, Bell Labs
 *
 * Flags controlling the elaborator.
 *)

structure ElabControl : ELAB_CONTROL =
struct

  local
	val priority = [10, 10, 7]
	val clear = 2
	val obscure = 6
	val prefix = "elab"

	val registry = ControlRegistry.new { help = "elaborator flags" }

	val _ = BasicControl.nest (prefix, registry, priority)

	val nextpri = ref 0

	fun new ob (n, h, d) = let
	    val r = ref d
	    val p = !nextpri
	    val ctl = Controls.control { name = n,
					 pri = [p],
					 obscurity = ob,
					 help = h,
					 ctl = r }
	in
	    nextpri := p + 1;
	    ControlRegistry.register
		registry
		{ ctl = Controls.stringControl ControlUtil.Cvt.bool ctl,
		  envName = SOME (ControlUtil.EnvName.toUpper "ELAB_" n) };
	    r
	end

	val cnew = new clear
	val onew = new obscure
  in

    val etdebugging = onew ("et-debugging", "ElabType debugging", false)
        (* ElabType *)
    val esdebugging = onew ("es-debugging", "ElabSig debugging", false)
        (* ElabSig *)
    val insdebugging = onew ("ins-debugging", "Instantiate debugging", false)
        (* Instantiate *)
    val smdebugging = onew ("sm-debugging", "Sigmatch debugging", false)
        (* Sigmatch *)
    val ecdebugging = onew ("ec-debugging", "ElabCore debugging", false)
        (* ElabCore *)
    val emdebugging = onew ("em-debugging", "ElabMod debugging", false)
        (* ElabMod *)
    val tcdebugging = onew ("tc-debugging", "TypeCheck debugging", false)
        (* Typecheck *)
    val unidebugging = onew ("uni-debugging", "Unify debugging", false)
        (* Unify *)
    val ovlddebugging = onew ("ovld-debugging", "Overload debugging", false)
        (* Unify *)
    val instantiateSigs = onew ("instantiate-sigs", "instantiate all sigs", true)
        (* ElabMod, Control_MC *)
    val etopdebugging = onew ("etop-debugging", "ElabTop debugging", false)
        (* ElabTop *)

    val internals = onew ("internals", "show internal reps", false)

    val markabsyn = onew ("markabsyn", "mark abstract syntax", true)
        (* ElabCore, ElabTop, ElabUtil, Control_MC *)                    

    val boxedconstconreps = onew ("boxedconstreps", "boxed const constructors", false)
        (* ConRep *)

    val multDefWarn = cnew ("mult-def-warn", "warn on multiple defs", false)
        (* Instantiate, Control_MC (TopLevel/main/control.sml) *)

    val shareDefError = cnew ("share-def-error", "check share defs", true)
        (* Instantiate, Control_MC *)

    val valueRestrictionLocalWarn =
	cnew ("value-restriction-local-warn", "warn on value restriction for local defs", false)

    val valueRestrictionTopWarn =
	cnew ("value-restriction-top-warn", "warn on value restriction at top level", true)

    val showTypeErrorCulprits =
	cnew ("show-type-error-culprits", "show culprits in type error messages", false)

  end (* local *)
end (* structure ElabControl *)