From 5b2898ae5cea5ee4729e4d449a145f3c59fc7e04 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Tue, 4 Mar 2014 00:26:33 +0900 Subject: [PATCH] rename read functions which return a list of multiple expressions to 'parse' --- include/picrin.h | 4 ++-- src/load.c | 2 +- src/macro.c | 2 +- src/read.c | 4 ++-- tools/main.c | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/picrin.h b/include/picrin.h index f477a170..119c71ec 100644 --- a/include/picrin.h +++ b/include/picrin.h @@ -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 *); diff --git a/src/load.c b/src/load.c index 8be96096..fd601f7e 100644 --- a/src/load.c +++ b/src/load.c @@ -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"); } diff --git a/src/macro.c b/src/macro.c index 3b24e64c..cd28a53d 100644 --- a/src/macro.c +++ b/src/macro.c @@ -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"); } diff --git a/src/read.c b/src/read.c index eb649849..52594a90 100644 --- a/src/read.c +++ b/src/read.c @@ -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; diff --git a/tools/main.c b/tools/main.c index 237e70e5..9be04045 100644 --- a/tools/main.c +++ b/tools/main.c @@ -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; }