reader: fix another here-string problem

This commit is contained in:
Matthew Flatt 2018-02-27 13:48:40 -07:00
parent e707d7decd
commit 613de748df
3 changed files with 6 additions and 3 deletions

View File

@ -219,6 +219,7 @@
(test "abc" readstr "#<<EOS\nabc\nEOS\n ")
(test "abc" readstr "#<<EOS\nabc\nEOS")
(test "ok\r\nmore\r" readstr "#<<EOS\r\nok\r\nmore\r\nEOS\r")
(test "" readstr "#<<EOS\nEOS\n")
(err/rt-test (readstr "#<<EOS\nabc\nEO") exn:fail:read?)
(err/rt-test (readstr "#<<EOS\r\nabc\nEOS") exn:fail:read?)

View File

@ -185,8 +185,10 @@
[(char=? c #\newline) null]
[else (cons c (loop))]))))
;; Get string content
(let loop ([terminator full-terminator] [terminator-accum null])
;; Get string content.
;; We just saw a newline that could be considered the start of an
;; immediate `full-terminator`.
(let loop ([terminator (cdr full-terminator)] [terminator-accum null])
(define c (read-char/special in config source))
(cond
[(eof-object? c)

View File

@ -52177,7 +52177,7 @@ static const char *startup_source =
"(accum-string-add! accum-str_5 c_88)"
"(loop_113 full-terminator_0 null)))))))))))))))"
" loop_113)"
" full-terminator_0"
"(cdr full-terminator_0)"
" null)"
"(values))))"
"(let-values(((str_31)"