| 62978 |      1 | (*  Title:      Pure/ML/ml_print_depth.ML
 | 
| 62878 |      2 |     Author:     Makarius
 | 
|  |      3 | 
 | 
|  |      4 | Print depth for ML toplevel pp: context option with global default.
 | 
|  |      5 | *)
 | 
|  |      6 | 
 | 
|  |      7 | signature ML_PRINT_DEPTH =
 | 
|  |      8 | sig
 | 
|  |      9 |   val set_print_depth: int -> unit
 | 
|  |     10 |   val print_depth: int Config.T
 | 
|  |     11 |   val get_print_depth: unit -> int
 | 
|  |     12 | end;
 | 
|  |     13 | 
 | 
|  |     14 | structure ML_Print_Depth: ML_PRINT_DEPTH =
 | 
|  |     15 | struct
 | 
|  |     16 | 
 | 
|  |     17 | val set_print_depth = ML_Print_Depth.set_print_depth;
 | 
|  |     18 | 
 | 
| 69575 |     19 | val print_depth =
 | 
|  |     20 |   Config.declare_int ("ML_print_depth", \<^here>) (fn _ => ML_Print_Depth.get_print_depth ());
 | 
| 62878 |     21 | 
 | 
|  |     22 | fun get_print_depth () =
 | 
| 62889 |     23 |   (case Context.get_generic_context () of
 | 
| 62878 |     24 |     NONE => ML_Print_Depth.get_print_depth ()
 | 
|  |     25 |   | SOME context => Config.get_generic context print_depth);
 | 
|  |     26 | 
 | 
|  |     27 | end;
 |