mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 20:45:06 +02:00
Handle datum comments
This commit is contained in:
parent
a125e1add6
commit
a492ea820c
2 changed files with 7 additions and 2 deletions
3
read.scm
3
read.scm
|
@ -777,6 +777,9 @@
|
||||||
(list 'unquote (parse2 fp)))
|
(list 'unquote (parse2 fp)))
|
||||||
((eq? token (string->symbol ",@"))
|
((eq? token (string->symbol ",@"))
|
||||||
(list 'unquote-splicing (parse2 fp)))
|
(list 'unquote-splicing (parse2 fp)))
|
||||||
|
((eq? token (string->symbol "#;"))
|
||||||
|
(parse2 fp) ;; Ignore next datum
|
||||||
|
(parse2 fp))
|
||||||
;; Other special cases?
|
;; Other special cases?
|
||||||
(else
|
(else
|
||||||
token))))
|
token))))
|
||||||
|
|
|
@ -5995,10 +5995,12 @@ void Cyc_io_read_token(void *data, object cont, object port)
|
||||||
_read_next_char(data, cont, p); // Fill buffer
|
_read_next_char(data, cont, p); // Fill buffer
|
||||||
c = p->mem_buf[p->buf_idx++];
|
c = p->mem_buf[p->buf_idx++];
|
||||||
p->col_num++;
|
p->col_num++;
|
||||||
// TODO: block comment
|
if (c == '|') { // Block comment
|
||||||
if (c == '|') {
|
|
||||||
_read_multiline_comment(p);
|
_read_multiline_comment(p);
|
||||||
continue;
|
continue;
|
||||||
|
} else if (c == ';') { // Datum comment
|
||||||
|
object sym = find_or_add_symbol("#;");
|
||||||
|
return_thread_runnable(data, sym);
|
||||||
} else if (c == 't') {
|
} else if (c == 't') {
|
||||||
if ((p->mem_buf_len - p->buf_idx) >= 3 &&
|
if ((p->mem_buf_len - p->buf_idx) >= 3 &&
|
||||||
p->mem_buf[p->buf_idx + 0] == 'r' &&
|
p->mem_buf[p->buf_idx + 0] == 'r' &&
|
||||||
|
|
Loading…
Add table
Reference in a new issue