From 0674c1638e41dba3528d3a1747b28fa726fccabf Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sat, 20 Sep 2014 23:59:47 -0400 Subject: [PATCH] Add `type-output-sexpr-tweaker'. Sounds like a bad name, but I don't have anything better. It's not some "current-...-print" thing since it works on the sexpr that is intended to be pretty-printed. So I went with the above. original commit: 3c98d086904409b9c49d710134415d718d6ca65e --- .../typed-racket-lib/typed-racket/types/printer.rkt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/printer.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/printer.rkt index 450d3462..84dd2665 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/printer.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/printer.rkt @@ -32,7 +32,7 @@ pretty-format-type))) (provide-printer) -(provide print-complex-filters? +(provide print-complex-filters? type-output-sexpr-tweaker current-print-type-fuel current-print-unexpanded) @@ -42,6 +42,7 @@ ;; do we use simple type aliases in printing (define print-aliases #t) +(define type-output-sexpr-tweaker (make-parameter values)) (define print-complex-filters? (make-parameter #f)) ;; this parameter controls how far down the type to expand type names @@ -97,7 +98,8 @@ (port-count-lines! out) (write-string (make-string indent #\space) out) (parameterize ([pretty-print-current-style-table type-style-table]) - (pretty-display (type->sexp type '()) out)) + (pretty-display ((type-output-sexpr-tweaker) (type->sexp type '())) + out)) (string-trim #:left? #f (substring (get-output-string out) indent))) ;; filter->sexp : Filter -> S-expression