src/Pure/ML/ml_options.ML
author wenzelm
Tue, 26 Oct 2021 16:01:05 +0200
changeset 74593 66f10c877542
parent 69575 f77cc54f6d47
permissions -rw-r--r--
clarified modules;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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: bool Config.T
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    10
  val exception_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_enabled: Context.generic option -> bool
62498
5dfcc9697f29 support for ML_exception_debugger;
wenzelm
parents: 60730
diff changeset
    12
  val exception_debugger: bool Config.T
5dfcc9697f29 support for ML_exception_debugger;
wenzelm
parents: 60730
diff changeset
    13
  val exception_debugger_enabled: Context.generic option -> bool
60730
02c2860fcf30 added option ML_debugger;
wenzelm
parents: 57834
diff changeset
    14
  val debugger: bool Config.T
02c2860fcf30 added option ML_debugger;
wenzelm
parents: 57834
diff changeset
    15
  val debugger_enabled: Context.generic option -> bool
56303
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    16
end;
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    17
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    18
structure ML_Options: ML_OPTIONS =
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    19
struct
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    20
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    21
(* source trace *)
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    22
69575
f77cc54f6d47 clarified signature: more types;
wenzelm
parents: 64556
diff changeset
    23
val source_trace = Config.declare_bool ("ML_source_trace", \<^here>) (K false);
56303
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    24
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    25
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    26
(* exception trace *)
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    27
69575
f77cc54f6d47 clarified signature: more types;
wenzelm
parents: 64556
diff changeset
    28
val exception_trace = Config.declare_option_bool ("ML_exception_trace", \<^here>);
56303
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    29
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    30
fun exception_trace_enabled NONE =
69575
f77cc54f6d47 clarified signature: more types;
wenzelm
parents: 64556
diff changeset
    31
      (Options.default_bool (Config.name_of exception_trace) handle ERROR _ => false)
56303
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    32
  | 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
    33
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    34
62498
5dfcc9697f29 support for ML_exception_debugger;
wenzelm
parents: 60730
diff changeset
    35
(* exception debugger *)
5dfcc9697f29 support for ML_exception_debugger;
wenzelm
parents: 60730
diff changeset
    36
69575
f77cc54f6d47 clarified signature: more types;
wenzelm
parents: 64556
diff changeset
    37
val exception_debugger = Config.declare_option_bool ("ML_exception_debugger", \<^here>);
62498
5dfcc9697f29 support for ML_exception_debugger;
wenzelm
parents: 60730
diff changeset
    38
5dfcc9697f29 support for ML_exception_debugger;
wenzelm
parents: 60730
diff changeset
    39
fun exception_debugger_enabled NONE =
69575
f77cc54f6d47 clarified signature: more types;
wenzelm
parents: 64556
diff changeset
    40
      (Options.default_bool (Config.name_of exception_debugger) handle ERROR _ => false)
62498
5dfcc9697f29 support for ML_exception_debugger;
wenzelm
parents: 60730
diff changeset
    41
  | exception_debugger_enabled (SOME context) = Config.get_generic context exception_debugger;
5dfcc9697f29 support for ML_exception_debugger;
wenzelm
parents: 60730
diff changeset
    42
5dfcc9697f29 support for ML_exception_debugger;
wenzelm
parents: 60730
diff changeset
    43
60730
02c2860fcf30 added option ML_debugger;
wenzelm
parents: 57834
diff changeset
    44
(* debugger *)
02c2860fcf30 added option ML_debugger;
wenzelm
parents: 57834
diff changeset
    45
69575
f77cc54f6d47 clarified signature: more types;
wenzelm
parents: 64556
diff changeset
    46
val debugger = Config.declare_option_bool ("ML_debugger", \<^here>);
60730
02c2860fcf30 added option ML_debugger;
wenzelm
parents: 57834
diff changeset
    47
02c2860fcf30 added option ML_debugger;
wenzelm
parents: 57834
diff changeset
    48
fun debugger_enabled NONE =
69575
f77cc54f6d47 clarified signature: more types;
wenzelm
parents: 64556
diff changeset
    49
      (Options.default_bool (Config.name_of debugger) handle ERROR _ => false)
60730
02c2860fcf30 added option ML_debugger;
wenzelm
parents: 57834
diff changeset
    50
  | debugger_enabled (SOME context) = Config.get_generic context debugger;
02c2860fcf30 added option ML_debugger;
wenzelm
parents: 57834
diff changeset
    51
56303
4cc3f4db3447 clarified Isabelle/ML bootstrap, such that Execution does not require ML_Compiler;
wenzelm
parents:
diff changeset
    52
end;