From cd3f1c87070ce6d5eea67a83751de65c7291dbaa Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 24 Apr 2009 17:34:49 +0000 Subject: [PATCH] fix zo-parse problem with graphs in literal data svn: r14596 original commit: 2439b4cb75c3b92179d764fb7dbe6f8c932a0f9f --- collects/compiler/zo-parse.ss | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/collects/compiler/zo-parse.ss b/collects/compiler/zo-parse.ss index bb76d1fb8b..6660c45300 100644 --- a/collects/compiler/zo-parse.ss +++ b/collects/compiler/zo-parse.ss @@ -729,7 +729,7 @@ [read-accept-dot #t] [read-accept-infix-dot #t] [read-accept-quasiquote #t]) - (read (open-input-bytes s))))] + (read/recursive (open-input-bytes s))))] [(reference) (make-primval (read-compact-number cp))] [(small-list small-proper-list) @@ -837,7 +837,17 @@ [(box) (box (read-compact cp))] [(quote) - (make-reader-graph (read-compact cp))] + (make-reader-graph + ;; Nested escapes need to share graph references. So get inside the + ;; read where `read/recursive' can be used: + (let ([rt (current-readtable)]) + (parameterize ([current-readtable (make-readtable + #f + #\x 'terminating-macro + (lambda args + (parameterize ([current-readtable rt]) + (read-compact cp))))]) + (read (open-input-bytes #"x")))))] [(symref) (let* ([l (read-compact-number cp)] [v (vector-ref (cport-symtab cp) l)])