From a492ea820c681136b5445f248a810f6f648a5baa Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Tue, 15 Aug 2017 13:23:16 +0000 Subject: [PATCH] Handle datum comments --- read.scm | 3 +++ runtime.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/read.scm b/read.scm index 9d04b907..84642e0b 100644 --- a/read.scm +++ b/read.scm @@ -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)))) diff --git a/runtime.c b/runtime.c index a573b072..1b5f778d 100644 --- a/runtime.c +++ b/runtime.c @@ -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' &&