1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-24 04:15:36 +02:00

Favor non-hex string escapes over hex escapes when writing strings

The characters U+0007 to U+000D have non-hex forms for their
escapes when in written strings.

* libguile/print.c (write_character): use non-hex escapes
* test-suite/tests/reader.test (write R6RS string escapes): adjust test
This commit is contained in:
Michael Gran 2010-09-26 12:25:18 -07:00
parent 8445eb1db5
commit c03ef352bc
2 changed files with 11 additions and 2 deletions

View file

@ -309,6 +309,7 @@
(pass-if "write R6RS string escapes"
(let* ((s1 (apply string
(map integer->char '(#x8 ; backspace
#x18 ; cancel
#x20 ; space
#x30 ; zero
#x40 ; at sign
@ -319,7 +320,7 @@
(lambda () (write s1)))))))
(lset= eqv?
(string->list s2)
(list #\" #\\ #\x #\8 #\; #\space #\0 #\@ #\"))))
(list #\" #\\ #\b #\\ #\x #\1 #\8 #\; #\space #\0 #\@ #\"))))
(pass-if "display R6RS string escapes"
(string=?