hash should have been hasheq...

svn: r16200
This commit is contained in:
John Clements 2009-10-01 17:52:45 +00:00
parent 352a74cc05
commit 224a9546b8

View File

@ -148,7 +148,7 @@
(reformat-sexp width) (reformat-sexp width)
(end-edit-sequence)))]) (end-edit-sequence)))])
(define highlight-table (make-weak-hash)) (define highlight-table (make-weak-hasheq))
(define stripped-exps (define stripped-exps
(map (lambda (exp) (strip-to-sexp exp highlight-table)) exps)) (map (lambda (exp) (strip-to-sexp exp highlight-table)) exps))
@ -181,8 +181,6 @@
; the pretty-print-size-hook decides whether this object should be printed by the new pretty-print-hook ; the pretty-print-size-hook decides whether this object should be printed by the new pretty-print-hook
[pretty-print-size-hook [pretty-print-size-hook
(lambda (value display? port) (lambda (value display? port)
(when (not highlight-table)
(fprintf (current-error-port) "hey! the highlight-table doesn't exist! (1)"))
(let ([looked-up (hash-ref highlight-table value (lambda () #f))]) (let ([looked-up (hash-ref highlight-table value (lambda () #f))])
(cond (cond
[(is-a? value snip%) [(is-a? value snip%)
@ -203,8 +201,6 @@
[pretty-print-print-hook [pretty-print-print-hook
; this print-hook is called for confusable highlights and for images. ; this print-hook is called for confusable highlights and for images.
(lambda (value display? port) (lambda (value display? port)
(when (not highlight-table)
(fprintf (current-error-port) "hey! the highlight-table doesn't exist! (2)"))
(let ([to-display (cond (let ([to-display (cond
[(hash-ref highlight-table value (lambda () #f)) => car] [(hash-ref highlight-table value (lambda () #f)) => car]
[else value])]) [else value])])
@ -223,14 +219,10 @@
0)] 0)]
[pretty-print-pre-print-hook [pretty-print-pre-print-hook
(lambda (value p) (lambda (value p)
(when (not highlight-table)
(fprintf (current-error-port) "hey! the highlight-table doesn't exist! (3)"))
(when (hash-ref highlight-table value (lambda () #f)) (when (hash-ref highlight-table value (lambda () #f))
(set! highlight-begin (get-start-position))))] (set! highlight-begin (get-start-position))))]
[pretty-print-post-print-hook [pretty-print-post-print-hook
(lambda (value p) (lambda (value p)
(when (not highlight-table)
(fprintf (current-error-port) "hey! the highlight-table doesn't exist! (4)"))
(when (hash-ref highlight-table value (lambda () #f)) (when (hash-ref highlight-table value (lambda () #f))
(let ([highlight-end (get-start-position)]) (let ([highlight-end (get-start-position)])
(unless highlight-begin (unless highlight-begin
@ -241,6 +233,7 @@
(set! highlight-begin #f))))] (set! highlight-begin #f))))]
;; mflatt: MAJOR HACK - this setting needs to come from the language ;; mflatt: MAJOR HACK - this setting needs to come from the language
;; somehow ;; somehow
;; jbc : this could be fixed in the same way that inexact-number printing is handled....
[read-case-sensitive #t] [read-case-sensitive #t]
) )
(pretty-print sexp text-port))) (pretty-print sexp text-port)))