* reader.c (read_string): Handle '\\'.
* tests/read.test: Add it.
int c = getchar ();
while (true) {
if (c == '"') break;
- if (c == '\\' && peekchar () == '"') p = append_char (p, getchar ());
+ if (c == '\\' && peekchar () == '\\') p = append_char (p, getchar ());
+ else if (c == '\\' && peekchar () == '"') p = append_char (p, getchar ());
else if (c == '\\' && peekchar () == 'n') {getchar (); p = append_char (p, '\n');}
else if (c == EOF) assert (!"EOF in string");
else p = append_char (p, c);
(display #x16) (newline)
(display #\A) (newline)
(display #\newline) (newline)
+#\alarm
+#\backspace
+#\tab
+#\newline
+#\vtab
+#\page
+#\return
+#\space
+(display "\"")
+(display "\\")
+(display "\\\"\"\\")
(display 'foo)(newline)
(display '(foo))(newline)
(display '('foo))(newline)