Handle datum comments

This commit is contained in:
Justin Ethier 2017-08-15 13:23:16 +00:00
parent a125e1add6
commit a492ea820c
2 changed files with 7 additions and 2 deletions

View file

@ -777,6 +777,9 @@
(list 'unquote (parse2 fp)))
((eq? token (string->symbol ",@"))
(list 'unquote-splicing (parse2 fp)))
((eq? token (string->symbol "#;"))
(parse2 fp) ;; Ignore next datum
(parse2 fp))
;; Other special cases?
(else
token))))

View file

@ -5995,10 +5995,12 @@ void Cyc_io_read_token(void *data, object cont, object port)
_read_next_char(data, cont, p); // Fill buffer
c = p->mem_buf[p->buf_idx++];
p->col_num++;
// TODO: block comment
if (c == '|') {
if (c == '|') { // Block comment
_read_multiline_comment(p);
continue;
} else if (c == ';') { // Datum comment
object sym = find_or_add_symbol("#;");
return_thread_runnable(data, sym);
} else if (c == 't') {
if ((p->mem_buf_len - p->buf_idx) >= 3 &&
p->mem_buf[p->buf_idx + 0] == 'r' &&