rename read functions which return a list of multiple expressions to 'parse'

This commit is contained in:
Yuichi Nishiwaki 2014-03-04 00:26:33 +09:00
parent 8a9bd366a1
commit 5b2898ae5c
5 changed files with 9 additions and 9 deletions

View File

@ -173,8 +173,8 @@ char *pic_strdup(pic_state *, const char *);
char *pic_strndup(pic_state *, const char *, size_t);
pic_value pic_read(pic_state *, const char *);
pic_list pic_read_file(pic_state *, FILE *); /* When input string is incomplete, returns undef. */
pic_list 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_load(pic_state *, const char *);

View File

@ -18,7 +18,7 @@ pic_load(pic_state *pic, const char *fn)
pic_error(pic, "load: could not read file");
}
exprs = pic_read_file(pic, file);
exprs = pic_parse_file(pic, file);
if (pic_undef_p(exprs)) {
pic_error(pic, "load: unexpected EOF");
}

View File

@ -627,7 +627,7 @@ pic_macro_include(pic_state *pic)
if (file == NULL) {
pic_error(pic, "could not open file");
}
exprs = pic_read_file(pic, file);
exprs = pic_parse_file(pic, file);
if (pic_undef_p(exprs)) {
pic_error(pic, "parse error");
}

View File

@ -216,7 +216,7 @@ pic_read(pic_state *pic, const char *cstr)
}
pic_list
pic_read_file(pic_state *pic, FILE *file)
pic_parse_file(pic_state *pic, FILE *file)
{
yyscan_t scanner;
struct parser_control ctrl;
@ -234,7 +234,7 @@ pic_read_file(pic_state *pic, FILE *file)
}
pic_list
pic_read_cstr(pic_state *pic, const char *cstr)
pic_parse_cstr(pic_state *pic, const char *cstr)
{
yyscan_t scanner;
struct parser_control ctrl;

View File

@ -104,7 +104,7 @@ repl(pic_state *pic)
pic_try {
/* read */
exprs = pic_read_cstr(pic, code);
exprs = pic_parse_cstr(pic, code);
if (pic_undef_p(exprs)) {
/* wait for more input */
@ -155,7 +155,7 @@ exec_file(pic_state *pic, const char *fname)
goto abort;
}
exprs = pic_read_file(pic, file);
exprs = pic_parse_file(pic, file);
if (pic_undef_p(exprs)) {
fprintf(stderr, "fatal error: %s broken\n", fname);
goto abort;
@ -193,7 +193,7 @@ exec_string(pic_state *pic, const char *str)
struct pic_proc *proc;
int ai;
exprs = pic_read_cstr(pic, str);
exprs = pic_parse_cstr(pic, str);
if (pic_undef_p(exprs)) {
goto abort;
}