From cae71f0b110ae15b79d5d75ca4122bcceb5f0e99 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Fri, 15 Dec 2017 21:54:19 -0800 Subject: [PATCH] correction --- sugar/debug.rkt | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/sugar/debug.rkt b/sugar/debug.rkt index 8590013..ccae6d8 100644 --- a/sugar/debug.rkt +++ b/sugar/debug.rkt @@ -100,7 +100,15 @@ (make-meta-reader 'sugar/debug "language path" - lang-reader-module-paths + (λ (bstr) ; copy of `lang-reader-module-paths`, only available since 6.7 + (let* ([str (bytes->string/latin-1 bstr)] + [sym (string->symbol str)]) + (and (module-path? sym) + (vector + ;; try submod first: + `(submod ,sym reader) + ;; fall back to /lang/reader: + (string->symbol (string-append str "/lang/reader")))))) wrap-reader wrap-reader (λ (proc) @@ -118,10 +126,10 @@ (define (report-proc trigger-char ip src ln col pos) (define flip-metalang-scope (current-metalang-scope-flipper)) (flip-metalang-scope (with-syntax ([REPORT-ID (cond - [(not (another-report-char? ip)) 'report] ; #R... - [(not (another-report-char? ip)) 'report/line] ; #RR... - [else 'report/file])] ; #RRR... - [STX (flip-metalang-scope (read-syntax/recursive src ip))]) - #'(let () - (local-require (only-in sugar/debug REPORT-ID)) - (REPORT-ID STX)))))) + [(not (another-report-char? ip)) 'report] ; #R... + [(not (another-report-char? ip)) 'report/line] ; #RR... + [else 'report/file])] ; #RRR... + [STX (flip-metalang-scope (read-syntax/recursive src ip))]) + #'(let () + (local-require (only-in sugar/debug REPORT-ID)) + (REPORT-ID STX))))))