Fixing intraline whitespace parsing followed immediately by another escape.

Fixes issue #343.
This commit is contained in:
Alex Shinn 2016-06-04 22:06:35 +09:00
parent 28148e52b7
commit 0a0db861ed
2 changed files with 9 additions and 0 deletions

View file

@ -85,6 +85,13 @@
(test 15.0 (read-from-string "#i#xf")) (test 15.0 (read-from-string "#i#xf"))
(test (expt 10 100) (read-from-string "#e1e100")) (test (expt 10 100) (read-from-string "#e1e100"))
(test "A\n\nB\n" (read-from-string "\"A\\n\\
\\n\\
B\n\""))
(test "A\n\n" (read-from-string "\"A\\n\\
\\n\\
\""))
(cond-expand (cond-expand
(chicken (chicken
(test-io "(#0=\"abc\" #0# #0#)" (test-io "(#0=\"abc\" #0# #0#)"

2
sexp.c
View file

@ -2207,6 +2207,8 @@ sexp sexp_read_string (sexp ctx, sexp in, int sentinel) {
if (c=='\n') { if (c=='\n') {
sexp_port_line(in)++; sexp_port_line(in)++;
do {c=sexp_read_char(ctx, in);} while (c==' ' || c=='\t'); do {c=sexp_read_char(ctx, in);} while (c==' ' || c=='\t');
sexp_push_char(ctx, c, in);
continue;
} }
} }
#endif #endif