delete pic_parse family

This commit is contained in:
Yuichi Nishiwaki 2014-09-01 13:23:32 +09:00
parent 1e8ab8bf0f
commit 03716567c9
2 changed files with 0 additions and 43 deletions

View File

@ -161,8 +161,6 @@ char *pic_strndup(pic_state *, const char *, size_t);
pic_value pic_read(pic_state *, struct pic_port *);
pic_value pic_read_cstr(pic_state *, const char *);
pic_list pic_parse_file(pic_state *, FILE *); /* #f for incomplete input */
pic_list pic_parse_cstr(pic_state *, const char *);
pic_value pic_apply(pic_state *, struct pic_proc *, pic_value);
pic_value pic_apply0(pic_state *, struct pic_proc *);

41
read.c
View File

@ -916,47 +916,6 @@ pic_read_cstr(pic_state *pic, const char *str)
return pic_read(pic, port);
}
static pic_value
pic_parse(pic_state *pic, struct pic_port *port)
{
pic_value val, acc;
pic_try {
acc = pic_nil_value();
while (! pic_eof_p(val = pic_read(pic, port))) {
pic_push(pic, val, acc);
}
}
pic_catch {
return pic_undef_value();
}
return pic_reverse(pic, acc);
}
pic_list
pic_parse_file(pic_state *pic, FILE *file)
{
struct pic_port *port;
port = (struct pic_port *)pic_obj_alloc(pic, sizeof(struct pic_port *), PIC_TT_PORT);
port->file = xfpopen(file);
port->flags = PIC_PORT_OUT | PIC_PORT_TEXT;
port->status = PIC_PORT_OPEN;
return pic_parse(pic, port);
}
pic_list
pic_parse_cstr(pic_state *pic, const char *str)
{
struct pic_port *port;
port = pic_open_input_string(pic, str);
return pic_parse(pic, port);
}
static pic_value
pic_read_read(pic_state *pic)
{