This commit is contained in:
Justin Ethier 2017-08-11 17:33:41 +00:00
parent 2d7839c264
commit 6c3adfa6b8
2 changed files with 10 additions and 13 deletions

View file

@ -693,7 +693,11 @@
; (repl)) ; (repl))
;(repl) ;(repl)
(write 'TODO) (define-c read-token
"(void *data, int argc, closure _, object k, object port)"
" Cyc_io_read_token(data, k, port);")
(read-token (open-input-file "generate-c.scm"))
;; Notes on writing a fast parser: ;; Notes on writing a fast parser:
; - Interface to the user is (read). This needs to be fast ; - Interface to the user is (read). This needs to be fast

View file

@ -5708,20 +5708,13 @@ void _read_whitespace(port_type *p) {}
void _read_error(void *data, port_type *p, const char *msg) void _read_error(void *data, port_type *p, const char *msg)
{ {
/* TODO: need equivalent of this: char buf[1024];
(define (parse-error msg lnum cnum) snprintf(buf, 1023, "Error (line %d, column %d): %s",
(error p->line_num, p->col_num, msg);
(string-append Cyc_rt_raise_msg(data, buf);
"Error (line "
(number->string lnum)
", char "
(number->string cnum)
"): "
msg)))
*/
} }
void Cyc_read_token(void *data, object cont, object port) void Cyc_io_read_token(void *data, object cont, object port)
{ {
Cyc_check_port(data, port); Cyc_check_port(data, port);
port_type *p = (port_type *)port; port_type *p = (port_type *)port;