Skip to content
This repository
Newer
Older
100644 131 lines (99 sloc) 3.024 kb
fccc6851 » MLstate
2011-06-21 Initial open-source release
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18
19 (**
20 OpaTop global properties.
21 @author Mathieu Barbin
22 *)
23
24 (**
25 Global properties are a collection of imperative statefull variables
26 of toggleling the behavior of the interpreter.
27
28 It is used essentially for debug.
29 *)
30
31 (**
32 GUIDELINES: keep alphabetic order of properties.
33 For toggle variables (modes) names are [property_set, property_get].
34
35 If it makes sense, add a corresponding directive for a dynamic switch
36 in OpaTopDirectives, and add a corresponding option in the command line
37 tool.
38 *)
39
40 (**
41 Assertion mode: compile or ignore assertions.
42 Default is on.
43 *)
44
45 val assert_set : bool -> unit
46 val assert_get : unit -> bool
47
48 (* (\** *)
49 (* DbGen mode: with or without dbgen. *)
50 (* Default is on. *)
51 (* *\) *)
52
53 (* val dbgen_set : bool -> unit *)
54 (* val dbgen_get : unit -> bool *)
55
56 (**
57 DbGen Debug mode: with or without dumping dbgen process.
58 Default is off.
59 *)
60
61 val dddbgen_set : bool -> unit
62 val dddbgen_get : unit -> bool
63
64
65 (**
66 Dump infered types and evaluated values.
67 *)
68 val dump_set : bool -> unit
69 val dump_get : unit -> bool
70
71 (**
72 Greedy mode: kill or continue in case of errors.
73 Default is off during stdlib and user files, and on during stdin.
74 *)
75
76 val greedy_set : bool -> unit
77 val greedy_get : unit -> bool
78
79
80 (**
81 Skip-evaluation mode: with or without evaluation.
82 Default is off.
83 *)
84
85 val noeval_set : bool -> unit
86 val noeval_get : unit -> bool
87
88
89 (**
90 Say if the prompt should be printed.
91 In practice, is set to true whenever we parse the stdin.
92 {[
93 # g(x) = x ;;
94 g : 'a -> 'a : <fun>
95 #
96 ]}
97 *)
98 val prompt_set : bool -> unit
99 val prompt_get : unit -> bool
100
101 (**
102 Where goes the standard output of the interpreter.
103 Default is stdout.
104 *)
105 val stdout : Format.formatter ref
106
107 (**
108 Restricted bypass mode: with or without checking.
109 Default is on.
110 *)
111
112 val restricted_bypass_set : bool -> unit
113 val restricted_bypass_get : unit -> bool
114
115 (**
116 Value restriction mode: set the level of value restriction.
117 Default is 0 (desactivated), 1 is normal, 2 is strict.
118 *)
119
120 val value_restriction_set : [`disabled|`normal|`strict] -> unit
121 val value_restriction_get : unit -> [`disabled|`normal|`strict]
122
123 (* (\** *)
124 (* Typer mode: with or without typing. *)
125 (* Default is on. *)
126 (* *\) *)
127
128 (* val typer_set : bool -> unit *)
129 (* val typer_get : unit -> bool *)
130
131 val switch_typechecker: string -> bool
Something went wrong with that request. Please try again.