src/Pure/ML-Systems/polyml.ML
changeset 56281 03c3d1a7c3b8
parent 56275 600f432ab556
child 56283 20cf88cd3188
equal deleted inserted replaced
56280:f7de8392a507 56281:03c3d1a7c3b8
   128 use "ML-Systems/ml_pretty.ML";
   128 use "ML-Systems/ml_pretty.ML";
   129 
   129 
   130 local
   130 local
   131   val depth = Unsynchronized.ref 10;
   131   val depth = Unsynchronized.ref 10;
   132 in
   132 in
   133   fun get_print_depth () = ! depth;
   133   fun get_default_print_depth () = ! depth;
   134   fun print_depth n = (depth := n; PolyML.print_depth n);
   134   fun put_default_print_depth n = (depth := n; PolyML.print_depth n);
       
   135   val _ = put_default_print_depth 10;
   135 end;
   136 end;
   136 
   137 
   137 val error_depth = PolyML.error_depth;
   138 val error_depth = PolyML.error_depth;
   138 
   139 
   139 val pretty_ml =
   140 val pretty_ml =
   173 fun toplevel_pp context (_: string list) pp =
   174 fun toplevel_pp context (_: string list) pp =
   174   use_text context (1, "pp") false
   175   use_text context (1, "pp") false
   175     ("PolyML.addPrettyPrinter (fn _ => fn _ => ml_pretty o Pretty.to_ML o (" ^ pp ^ "))");
   176     ("PolyML.addPrettyPrinter (fn _ => fn _ => ml_pretty o Pretty.to_ML o (" ^ pp ^ "))");
   176 
   177 
   177 val ml_make_string =
   178 val ml_make_string =
   178   "(fn x => Pretty.string_of (Pretty.from_ML (pretty_ml (PolyML.prettyRepresentation (x, get_print_depth ())))))";
   179   "(fn x => Pretty.string_of (Pretty.from_ML (pretty_ml (PolyML.prettyRepresentation (x, ML_Compiler.get_print_depth ())))))";
   179 
   180