"\xNN;" inline hex escapes should also support uppercase \X.

Fixes issue #347.
This commit is contained in:
Alex Shinn 2016-06-04 22:19:43 +09:00
parent 0a0db861ed
commit 60448d1d3b
2 changed files with 2 additions and 2 deletions

View file

@ -273,7 +273,7 @@
((#\newline) (skip-horizontal-whitespace in) #f) ((#\newline) (skip-horizontal-whitespace in) #f)
((#\space #\tab) ((#\space #\tab)
(skip-line in) (skip-horizontal-whitespace in) #f) (skip-line in) (skip-horizontal-whitespace in) #f)
((#\x) ((#\x #\X)
(let* ((n (read-number 16)) (let* ((n (read-number 16))
(ch2 (read-char in))) (ch2 (read-char in)))
(if (not (and n (eqv? ch2 #\;))) (if (not (and n (eqv? ch2 #\;)))

2
sexp.c
View file

@ -2177,7 +2177,7 @@ sexp sexp_read_string (sexp ctx, sexp in, int sentinel) {
case 'n': c = '\n'; break; case 'n': c = '\n'; break;
case 'r': c = '\r'; break; case 'r': c = '\r'; break;
case 't': c = '\t'; break; case 't': c = '\t'; break;
case 'x': case 'x': case 'X':
res = sexp_read_number(ctx, in, 16, 0); res = sexp_read_number(ctx, in, 16, 0);
if (sexp_fixnump(res)) { if (sexp_fixnump(res)) {
c = sexp_read_char(ctx, in); c = sexp_read_char(ctx, in);