commit 64b1c3f7bcd95d58e2efcd6ae38737244f0bbbd4
parent 85a0ef9a5a38ce62f0e78296355b7d588403a46d
Author: Carl Eastlund <cce@racket-lang.org>
Date: Tue, 6 Oct 2009 21:33:54 +0000
Abstracted out a function to set printing parameters for the
macro debugger and the syntax browser.
Set all printing parameters to their defaults (as observed
from both mzscheme and drscheme).
svn: r16254
original commit: cf5c0a1b08b48b621b7fa2b64507d49af56019af
Diffstat:
3 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/collects/macro-debugger/stepper-text.ss b/collects/macro-debugger/stepper-text.ss
@@ -107,16 +107,8 @@
(parameterize
([pretty-print-size-hook pp-size-hook]
[pretty-print-print-hook pp-print-hook]
- [pretty-print-current-style-table (pp-extend-style-table)]
- ;; Printing parameters (mzscheme manual 7.9.1.4)
- [print-unreadable #t]
- [print-graph #f]
- [print-struct #f]
- [print-box #t]
- [print-vector-length #t]
- [print-hash-table #f]
- [print-honu #f])
- (pretty-print datum)))
+ [pretty-print-current-style-table (pp-extend-style-table)])
+ (pretty-print/defaults datum)))
(define (->show-function show)
(cond [(procedure? show)
diff --git a/collects/macro-debugger/syntax-browser/pretty-helper.ss b/collects/macro-debugger/syntax-browser/pretty-helper.ss
@@ -1,6 +1,7 @@
#lang scheme/base
(require scheme/class
+ scheme/pretty
macro-debugger/util/class-iop
syntax/stx
"interfaces.ss")
@@ -20,6 +21,18 @@
;; If they were always wrapped, the pretty-printer would screw up
;; list printing (I think).
+(define (pretty-print/defaults datum [port (current-output-port)])
+ (parameterize
+ (;; Printing parameters (defaults from MzScheme and DrScheme 4.2.2.2)
+ [print-unreadable #t]
+ [print-graph #f]
+ [print-struct #t]
+ [print-box #t]
+ [print-vector-length #f]
+ [print-hash-table #t]
+ [print-honu #f])
+ (pretty-print datum port)))
+
(define-struct syntax-dummy (val))
;; A SuffixOption is one of
diff --git a/collects/macro-debugger/syntax-browser/pretty-printer.ss b/collects/macro-debugger/syntax-browser/pretty-printer.ss
@@ -52,16 +52,8 @@
[pretty-print-size-hook pp-size-hook]
[pretty-print-print-hook pp-print-hook]
[pretty-print-current-style-table (pp-extend-style-table identifier-list)]
- [pretty-print-columns columns]
- ;; Printing parameters (mzscheme manual 7.9.1.4)
- [print-unreadable #t]
- [print-graph #f]
- [print-struct #t]
- [print-box #t]
- [print-vector-length #t]
- [print-hash-table #f]
- [print-honu #f])
- (pretty-print datum port)
+ [pretty-print-columns columns])
+ (pretty-print/defaults datum port)
(new range%
(range-builder range-builder)
(identifier-list identifier-list))))