more cleanup of the rendering for the case when (format "~s" x)

and (format "~a" x) are different (when 'x' is a symbol)
This commit is contained in:
Robby Findler 2011-12-14 06:28:05 -06:00
parent 6960767508
commit c91d004729
2 changed files with 20 additions and 1 deletions

View File

@ -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]

View File

@ -54,6 +54,25 @@
(make-pict-token 0 1 'pict)
(make-pict-token 1 0 'pict)))))
(test (replace-pict-tokens
(build-lines
'(|+1|)
(normalize-lw
(to-lw
,(term
(|+1| x))))))
(list (make-line 0
(list (make-spacer-token 0 2)
(make-string-token 2 1 "(" 'roman)
(make-string-token 3 4 "+1" '(italic . roman))
(make-string-token 7 1 " " 'roman)
(make-string-token 8 1 "x" 'swiss)
(make-string-token 9 1 ")" 'roman)))
(make-line 0
(list (make-string-token 0 0 "" 'roman)
(make-pict-token 0 1 'pict)
(make-pict-token 1 0 'pict)))))
(test (replace-pict-tokens
(build-lines
'()