# HG changeset patch # User wenzelm # Date 1237664329 -3600 # Node ID cc18ae3c1c7f40cfa5d87d21a83bfc51159ebfa9 # Parent 4078276bcace17e42c59ebf5ca7b5372a1e74e94 extra toplevel pretty-printing for Poly/ML; experimental version for Poly/ML 5.3; diff -r 4078276bcace -r cc18ae3c1c7f src/Pure/IsaMakefile --- a/src/Pure/IsaMakefile Sat Mar 21 20:00:23 2009 +0100 +++ b/src/Pure/IsaMakefile Sat Mar 21 20:38:49 2009 +0100 @@ -69,7 +69,8 @@ Isar/spec_parse.ML Isar/specification.ML Isar/theory_target.ML \ Isar/toplevel.ML Isar/value_parse.ML ML/ml_antiquote.ML \ ML/ml_context.ML ML/ml_lex.ML ML/ml_parse.ML ML/ml_syntax.ML \ - ML/ml_thms.ML ML-Systems/install_pp_polyml.ML Proof/extraction.ML \ + ML/ml_thms.ML ML-Systems/install_pp_polyml.ML \ + ML-Systems/install_pp_polyml-experimental.ML Proof/extraction.ML \ Proof/proof_rewrite_rules.ML Proof/proof_syntax.ML \ Proof/proofchecker.ML Proof/reconstruct.ML ProofGeneral/ROOT.ML \ ProofGeneral/pgip.ML ProofGeneral/pgip_input.ML \ diff -r 4078276bcace -r cc18ae3c1c7f src/Pure/ML-Systems/install_pp_polyml-experimental.ML --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Pure/ML-Systems/install_pp_polyml-experimental.ML Sat Mar 21 20:38:49 2009 +0100 @@ -0,0 +1,27 @@ +(* Title: Pure/ML-Systems/install_pp_polyml-experimental.ML + +Extra toplevel pretty-printing for Poly/ML; experimental version for +Poly/ML 5.3. +*) + +local + +fun pretty_future depth (pretty: 'a * int -> pretty) (x: 'a future) = + (case Future.peek x of + NONE => PrettyString "" + | SOME (Exn.Exn _) => PrettyString "" + | SOME (Exn.Result y) => pretty (y, depth)); + +fun pretty_lazy depth (pretty: 'a * int -> pretty) (x: 'a lazy) = + (case Lazy.peek x of + NONE => PrettyString "" + | SOME (Exn.Exn _) => PrettyString "" + | SOME (Exn.Result y) => pretty (y, depth)); + +in + +val _ = addPrettyPrinter pretty_future; +val _ = addPrettyPrinter pretty_lazy; + +end; +