diff --git a/collects/redex/private/loc-wrapper-rt.rkt b/collects/redex/private/loc-wrapper-rt.rkt index b69474d6ab..f71b702764 100644 --- a/collects/redex/private/loc-wrapper-rt.rkt +++ b/collects/redex/private/loc-wrapper-rt.rkt @@ -58,7 +58,7 @@ [(string? e) (values line col (+ col (string-length e)))] [(symbol? e) - (values line col (+ col (string-length (symbol->string e))))] + (values line col (+ col (string-length (format "~s" e))))] [(not e) (values line col col)] [else (let loop ([lws e] diff --git a/collects/redex/tests/lw-test.rkt b/collects/redex/tests/lw-test.rkt index 89dd8babc2..869d72cfd0 100644 --- a/collects/redex/tests/lw-test.rkt +++ b/collects/redex/tests/lw-test.rkt @@ -262,6 +262,14 @@ 2)) 0 0 0 3)) + (test (normalize-lw (to-lw (|+1| x))) + (build-lw + (list (build-lw "(" 0 0 0 1) + (build-lw '|+1| 0 0 1 4) + (build-lw 'x 0 0 6 1) + (build-lw ")" 0 0 7 1)) + 0 0 0 8)) + ;; this one seems suspicious: why does the second comma start at 1 instead of 0? ;; rendering seems to work, however, so we'll go with it .. (test (normalize-lw (to-lw ,,x))