mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-07 05:06:37 +02:00
adding \xNN escapes to string literals
This commit is contained in:
parent
8b590bd70c
commit
307f81c315
1 changed files with 7 additions and 0 deletions
7
sexp.c
7
sexp.c
|
@ -1371,6 +1371,13 @@ sexp sexp_read_string (sexp ctx, sexp in) {
|
||||||
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':
|
||||||
|
c = sexp_read_char(ctx, in);
|
||||||
|
if (isxdigit(c)) {
|
||||||
|
c = digit_value(c)*16 + digit_value(sexp_read_char(ctx, in));
|
||||||
|
} else {
|
||||||
|
sexp_push_char(ctx, c, in); c = 'x';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (c == EOF) {
|
if (c == EOF) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue