adjust the lw construction in Redex so that it uses the width of the
"canonical" way to write symbols, instead of the way they are displayed. This makes a difference for symbols that have spaces in them or symbols that, when displayed, look like numbers or other non-symbol things.
This commit is contained in:
parent
ce3e46b71a
commit
040bd371b6
|
@ -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]
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue
Block a user