| author | haftmann |
| Sun, 08 Jun 2014 23:30:53 +0200 | |
| changeset 57196 | d9a18e44b80d |
| parent 56438 | 7f6b2634d853 |
| child 57834 | 0d295e339f52 |
| permissions | -rw-r--r-- |
|
56303
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
1 |
(* Title: Pure/ML/ml_options.ML |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
2 |
Author: Makarius |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
3 |
|
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
4 |
ML configuration options. |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
5 |
*) |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
6 |
|
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
7 |
signature ML_OPTIONS = |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
8 |
sig |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
9 |
val source_trace_raw: Config.raw |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
10 |
val source_trace: bool Config.T |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
11 |
val exception_trace_raw: Config.raw |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
12 |
val exception_trace: bool Config.T |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
13 |
val exception_trace_enabled: Context.generic option -> bool |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
14 |
val print_depth_raw: Config.raw |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
15 |
val print_depth: int Config.T |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
16 |
val get_print_depth: unit -> int |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
17 |
end; |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
18 |
|
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
19 |
structure ML_Options: ML_OPTIONS = |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
20 |
struct |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
21 |
|
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
22 |
(* source trace *) |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
23 |
|
| 56438 | 24 |
val source_trace_raw = |
25 |
Config.declare ("ML_source_trace", @{here}) (fn _ => Config.Bool false);
|
|
|
56303
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
26 |
val source_trace = Config.bool source_trace_raw; |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
27 |
|
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
28 |
|
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
29 |
(* exception trace *) |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
30 |
|
| 56438 | 31 |
val exception_trace_raw = Config.declare_option ("ML_exception_trace", @{here});
|
|
56303
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
32 |
val exception_trace = Config.bool exception_trace_raw; |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
33 |
|
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
34 |
fun exception_trace_enabled NONE = |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
35 |
(Options.default_bool (Config.name_of exception_trace_raw) handle ERROR _ => false) |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
36 |
| exception_trace_enabled (SOME context) = Config.get_generic context exception_trace; |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
37 |
|
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
38 |
|
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
39 |
(* print depth *) |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
40 |
|
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
41 |
val print_depth_raw = |
| 56438 | 42 |
Config.declare ("ML_print_depth", @{here}) (fn _ => Config.Int (get_default_print_depth ()));
|
|
56303
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
43 |
val print_depth = Config.int print_depth_raw; |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
44 |
|
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
45 |
fun get_print_depth () = |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
46 |
(case Context.thread_data () of |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
47 |
NONE => get_default_print_depth () |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
48 |
| SOME context => Config.get_generic context print_depth); |
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
49 |
|
|
4cc3f4db3447
clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff
changeset
|
50 |
end; |