diff --git a/module/mes/read-0.mes b/module/mes/read-0.mes index 8d59bb17..dddfaa79 100644 --- a/module/mes/read-0.mes +++ b/module/mes/read-0.mes @@ -71,6 +71,7 @@ (cond ((eq? (peek-byte) 9) (read-byte) (eat-whitespace)) ((eq? (peek-byte) 10) (read-byte) (eat-whitespace)) + ((eq? (peek-byte) 12) (read-byte) (eat-whitespace)) ((eq? (peek-byte) 13) (read-byte) (eat-whitespace)) ((eq? (peek-byte) 32) (read-byte) (eat-whitespace)) ((eq? (peek-byte) 59) (begin (read-line-comment (read-byte)) @@ -112,6 +113,7 @@ ((eq? c -1) (list)) ((eq? c 10) (if (null? w) (read-word (read-byte) (list) a) (lookup w a))) + ((eq? c 12) (read-word 10 w a)) ((eq? c 32) (read-word 10 w a)) ((eq? c 34) (if (null? w) (read-string) (begin (unread-byte c) (lookup w a)))) diff --git a/reader.c b/reader.c index 46f293a2..2e4ad091 100644 --- a/reader.c +++ b/reader.c @@ -57,6 +57,8 @@ SCM read_word (int c, SCM w, SCM a) { if (c == EOF && w == cell_nil) return cell_nil; + if (c == '\t') return read_word ('\n', w, a); + if (c == '\f') return read_word ('\n', w, a); if (c == '\n' && w == cell_nil) return read_word (getchar (), w, a); if (c == '\n' && VALUE (car (w)) == '.' && cdr (w) == cell_nil) return cell_dot; if (c == EOF || c == '\n') return lookup (w, a); @@ -177,7 +179,7 @@ read_string () int eat_whitespace (int c) { - while (c == ' ' || c == '\t' || c == '\n') c = getchar (); + while (c == ' ' || c == '\t' || c == '\n' || c == '\f') c = getchar (); if (c == ';') return eat_whitespace (read_line_comment (c)); #if READER if (c == '#' && peekchar () == '!') {getchar (); read_block_comment (getchar ()); return eat_whitespace (getchar ());}