From 2743a31f3ccd81b19f635f7c89d738e3fc3bb208 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Tue, 1 Oct 2002 02:02:01 +0000 Subject: [PATCH] .. original commit: 30b1e8cb2f4ccdaf87080899798b529fc6085868 --- collects/drscheme/private/syntax-browser.ss | 23 ++++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/collects/drscheme/private/syntax-browser.ss b/collects/drscheme/private/syntax-browser.ss index 96b1fb82..ef43bb4c 100644 --- a/collects/drscheme/private/syntax-browser.ss +++ b/collects/drscheme/private/syntax-browser.ss @@ -30,7 +30,7 @@ needed to really make this work: (define syntax-snipclass% (class snip-class% (define/override (read stream) - (let ([str (send stream get-str)]) + (let ([str (send stream get-string)]) (make-object syntax-snip% (unmarshall-syntax (read-from-string str))))) (super-instantiate ()))) @@ -101,10 +101,12 @@ needed to really make this work: (piece-of-info "Column" (syntax-column stx)) (piece-of-info "Span" (syntax-span stx)) (piece-of-info "Original?" (syntax-original? stx)) - (insert/big "Properties\n") - (for-each - (lambda (prop) (show-property stx prop)) - (syntax-properties stx))) + (let ([properties (syntax-properties stx)]) + (unless (null? properties) + (insert/big "Properties\n") + (for-each + (lambda (prop) (show-property stx prop)) + properties)))) (define (show-property stx prop) (piece-of-info (format "'~a" prop) (syntax-property stx prop))) @@ -465,8 +467,8 @@ needed to really make this work: (span ,(syntax-span stx)) (original? ,(syntax-original? stx)) (properties - ,@(map (lambda (x) `(,x ,(syntax-property x 'bound-in-source))) - (syntax-properties x))) + ,@(map (lambda (x) `(,x ,(syntax-property stx x))) + (syntax-properties stx))) (contents ,(marshall-object (syntax-e stx))))) @@ -478,7 +480,12 @@ needed to really make this work: [(pair? obj) `(pair ,(cons (marshall-object (car obj)) (marshall-object (cdr obj))))] - [else `(other ,obj)])) + [(or (symbol? obj) + (char? obj) + (string? obj) + (boolean? obj)) + `(other ,obj)] + [else 'unknown-object])) (define (unmarshall-syntax stx) (match stx