In ##sys#read, for "\0xx" report "invalid escape-sequence '\0xx'" instead of
"invalid escape-sequence '\xx'".
---
library.scm | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/library.scm b/library.scm
index 7620808..76c2384 100644
--- a/library.scm
+++ b/library.scm
@@ -2460,7 +2460,7 @@ EOF
(##sys#read-error
port
(string-append
- "invalid escape-sequence '\\" u str "\'")) ) )
+ "invalid escape-sequence '\\" (string u) str "\'")) )
)
(let ((x (##sys#read-char-0 port)))
(if (or (eof-object? x) (char=? #\" x))
(##sys#read-error port "unterminated string constant")
@@ -2489,14 +2489,14 @@ EOF
((#\v) (loop (##sys#read-char-0 port) (cons
(integer->char 11) lst)))
((#\f) (loop (##sys#read-char-0 port) (cons
(integer->char 12) lst)))
((#\x)
- (let ([ch (integer->char (r-usequence "x" 2 16))])
+ (let ([ch (integer->char (r-usequence #\x 2 16))])
(loop (##sys#read-char-0 port) (cons ch lst)) ) )
((#\u)
- (let ([n (r-usequence "u" 4 16)])
+ (let ([n (r-usequence #\u 4 16)])
(if (##sys#unicode-surrogate? n)
(if (and (eqv? #\\ (##sys#read-char-0 port))
(eqv? #\u (##sys#read-char-0 port)))
- (let* ((m (r-usequence "u" 4 16))
+ (let* ((m (r-usequence #\u 4 16))
(cp (##sys#surrogates->codepoint n m)))
(if cp
(loop (##sys#read-char-0 port)
@@ -2505,7 +2505,7 @@ EOF
(##sys#read-error port "unpaired escaped
surrogate" n))
(loop (##sys#read-char-0 port) (r-cons-codepoint
n lst)) ) ))
((#\U)
- (let ([n (r-usequence "U" 8 16)])
+ (let ([n (r-usequence #\U 8 16)])
(if (##sys#unicode-surrogate? n)
(##sys#read-error port (string-append "invalid
escape (surrogate)" n))
(loop (##sys#read-char-0 port) (r-cons-codepoint
n lst)) )))
@@ -2517,7 +2517,7 @@ EOF
(char<=? c #\7))
(let ((ch (integer->char
(fx+ (fx* (fx- (char->integer c) 48)
64)
- (r-usequence "" 2 8)))))
+ (r-usequence c 2 8)))))
(loop (##sys#read-char-0 port) (cons ch lst))
))
(else
(##sys#read-warning
--
1.7.2.5
_______________________________________________
Chicken-hackers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-hackers