mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 21:40:33 +02:00
Handle <eof> in reader's character escape sequences
* module/ice-9/read.scm (read-r6rs-hex-escape, read-fixed-hex-escape): modified
This commit is contained in:
parent
9fb550b945
commit
1ae9a8df3a
1 changed files with 6 additions and 0 deletions
|
@ -249,8 +249,12 @@
|
|||
(cond
|
||||
((hex-digit ch) => (lambda (digit) (lp (+ (* 16 res) digit))))
|
||||
((eqv? ch #\;) (integer->char res))
|
||||
((eof-object? ch)
|
||||
(error "unexpected end of input in character escape sequence"))
|
||||
(else
|
||||
(error "invalid character in escape sequence: ~S" ch)))))))
|
||||
((eof-object? ch)
|
||||
(error "unexpected end of input in character escape sequence"))
|
||||
(else
|
||||
(error "invalid character in escape sequence: ~S" ch)))))
|
||||
|
||||
|
@ -263,6 +267,8 @@
|
|||
((hex-digit ch) =>
|
||||
(lambda (digit)
|
||||
(lp (1- len) (+ (* res 16) digit))))
|
||||
((eof-object? ch)
|
||||
(error "unexpected end of input in character escape sequence"))
|
||||
(else
|
||||
(error "invalid character in escape sequence: ~S" ch)))))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue