>From 6f3b76200f586517f714e5a49d09704ee8d238e4 Mon Sep 17 00:00:00 2001 From: Florian Zumbiehl Date: Thu, 14 Mar 2013 09:20:28 +0100 Subject: [PATCH] In ##sys#read, for "\0xx" report "invalid escape-sequence '\0xx'" instead of "invalid escape-sequence '\xx'". Signed-off-by: Peter Bex --- library.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library.scm b/library.scm index 5a2862e..2a4aa92 100644 --- a/library.scm +++ b/library.scm @@ -2466,7 +2466,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") @@ -2495,14 +2495,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 c 2 16))]) (loop (##sys#read-char-0 port) (cons ch lst)) ) ) ((#\u) - (let ([n (r-usequence "u" 4 16)]) + (let ([n (r-usequence c 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 c 4 16)) (cp (##sys#surrogates->codepoint n m))) (if cp (loop (##sys#read-char-0 port) @@ -2511,7 +2511,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 c 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)) ))) @@ -2523,7 +2523,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.8.0.1