From 6d79e54a4d5d93e7522e784ab8f03df7d108c644 Mon Sep 17 00:00:00 2001 From: Carl Eastlund Date: Fri, 8 Jul 2011 01:22:26 -0400 Subject: [PATCH] Changed source-location->string and ->prefix to use path->relative-string/library to produce collection and planet-relative source names. (cherry picked from commit 00a6442712759ebabe56fc57b58bcf3c93d1e914) --- collects/syntax/srcloc.rkt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/collects/syntax/srcloc.rkt b/collects/syntax/srcloc.rkt index c81c099b77..efd1da1ae1 100644 --- a/collects/syntax/srcloc.rkt +++ b/collects/syntax/srcloc.rkt @@ -37,6 +37,9 @@ ) +(require + setup/path-to-relative) + (define (source-location? x) (process-source-location x good? bad? 'source-location?)) @@ -163,7 +166,9 @@ (define ((good-string default) x src line col pos span) (format "~a~a" - (or src default) + (cond + [(path-string? src) (path->relative-string/library src)] + [else (or src default)]) (if line (if col (format ":~a.~a" line col)