From bfe6cef4c8bd6abebcd8b01e044dd3d740bf11bd Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 21 Feb 2016 20:21:02 +0900 Subject: [PATCH] pic_sym -> symbol, pic_id -> identifier --- extlib/benz/bool.c | 2 +- extlib/benz/dict.c | 2 +- extlib/benz/gc.c | 2 +- extlib/benz/include/picrin/private/object.h | 14 +++++++------- extlib/benz/macro.c | 2 +- extlib/benz/symbol.c | 10 +++++----- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/extlib/benz/bool.c b/extlib/benz/bool.c index 35ec40d3..09ea02a2 100644 --- a/extlib/benz/bool.c +++ b/extlib/benz/bool.c @@ -94,7 +94,7 @@ internal_equal_p(pic_state *pic, pic_value x, pic_value y, int depth, khash_t(m) switch (pic_type(pic, x)) { case PIC_TYPE_ID: { - pic_id *id1, *id2; + identifier *id1, *id2; pic_value s1, s2; id1 = pic_id_ptr(pic, x); diff --git a/extlib/benz/dict.c b/extlib/benz/dict.c index cfbf73ff..a4b209c4 100644 --- a/extlib/benz/dict.c +++ b/extlib/benz/dict.c @@ -6,7 +6,7 @@ #include "picrin/extra.h" #include "picrin/private/object.h" -KHASH_DEFINE(dict, pic_sym *, pic_value, kh_ptr_hash_func, kh_ptr_hash_equal) +KHASH_DEFINE(dict, symbol *, pic_value, kh_ptr_hash_func, kh_ptr_hash_equal) pic_value pic_make_dict(pic_state *pic) diff --git a/extlib/benz/gc.c b/extlib/benz/gc.c index 985ea214..b5030ae0 100644 --- a/extlib/benz/gc.c +++ b/extlib/benz/gc.c @@ -620,7 +620,7 @@ gc_sweep_phase(pic_state *pic) int it; khash_t(weak) *h; khash_t(oblist) *s = &pic->oblist; - pic_sym *sym; + symbol *sym; struct pic_object *obj; size_t total = 0, inuse = 0; diff --git a/extlib/benz/include/picrin/private/object.h b/extlib/benz/include/picrin/private/object.h index 6f50bdfb..e6e2035c 100644 --- a/extlib/benz/include/picrin/private/object.h +++ b/extlib/benz/include/picrin/private/object.h @@ -11,11 +11,11 @@ extern "C" { #include "picrin/private/khash.h" -typedef struct pic_identifier pic_id; -typedef pic_id pic_sym; +typedef struct pic_identifier identifier; +typedef identifier symbol; -KHASH_DECLARE(env, pic_id *, pic_sym *) -KHASH_DECLARE(dict, pic_sym *, pic_value) +KHASH_DECLARE(env, identifier *, symbol *) +KHASH_DECLARE(dict, symbol *, pic_value) KHASH_DECLARE(weak, struct pic_object *, pic_value) #define PIC_OBJECT_HEADER \ @@ -119,7 +119,7 @@ struct pic_record { struct pic_error { PIC_OBJECT_HEADER - pic_sym *type; + symbol *type; struct pic_string *msg; pic_value irrs; struct pic_string *stack; @@ -140,8 +140,8 @@ struct pic_checkpoint { struct pic_object *pic_obj_ptr(pic_value); -#define pic_id_ptr(pic, o) (assert(pic_id_p(pic, o)), (pic_id *)pic_obj_ptr(o)) -#define pic_sym_ptr(pic, o) (assert(pic_sym_p(pic, o)), (pic_sym *)pic_obj_ptr(o)) +#define pic_id_ptr(pic, o) (assert(pic_id_p(pic, o)), (identifier *)pic_obj_ptr(o)) +#define pic_sym_ptr(pic, o) (assert(pic_sym_p(pic, o)), (symbol *)pic_obj_ptr(o)) #define pic_str_ptr(pic, o) (assert(pic_str_p(pic, o)), (struct pic_string *)pic_obj_ptr(o)) #define pic_blob_ptr(pic, o) (assert(pic_blob_p(pic, o)), (struct pic_blob *)pic_obj_ptr(o)) #define pic_pair_ptr(pic, o) (assert(pic_pair_p(pic, o)), (struct pic_pair *)pic_obj_ptr(o)) diff --git a/extlib/benz/macro.c b/extlib/benz/macro.c index b1e710d5..8028f6cf 100644 --- a/extlib/benz/macro.c +++ b/extlib/benz/macro.c @@ -7,7 +7,7 @@ #include "picrin/private/object.h" #include "picrin/private/state.h" -KHASH_DEFINE(env, pic_id *, pic_sym *, kh_ptr_hash_func, kh_ptr_hash_equal) +KHASH_DEFINE(env, identifier *, symbol *, kh_ptr_hash_func, kh_ptr_hash_equal) pic_value pic_make_env(pic_state *pic, pic_value up) diff --git a/extlib/benz/symbol.c b/extlib/benz/symbol.c index 8ebd3913..3f40ef43 100644 --- a/extlib/benz/symbol.c +++ b/extlib/benz/symbol.c @@ -10,13 +10,13 @@ #define kh_pic_str_hash(a) (pic_str_hash(pic, pic_obj_value(a))) #define kh_pic_str_cmp(a, b) (pic_str_cmp(pic, pic_obj_value(a), pic_obj_value(b)) == 0) -KHASH_DEFINE(oblist, struct pic_string *, pic_sym *, kh_pic_str_hash, kh_pic_str_cmp) +KHASH_DEFINE(oblist, struct pic_string *, symbol *, kh_pic_str_hash, kh_pic_str_cmp) pic_value pic_intern(pic_state *pic, pic_value str) { khash_t(oblist) *h = &pic->oblist; - pic_sym *sym; + symbol *sym; int it; int ret; @@ -29,7 +29,7 @@ pic_intern(pic_state *pic, pic_value str) kh_val(h, it) = NULL; /* dummy */ - sym = (pic_sym *)pic_obj_alloc(pic, offsetof(pic_sym, env), PIC_TYPE_SYMBOL); + sym = (symbol *)pic_obj_alloc(pic, offsetof(symbol, env), PIC_TYPE_SYMBOL); sym->u.str = pic_str_ptr(pic, str); kh_val(h, it) = sym; @@ -39,9 +39,9 @@ pic_intern(pic_state *pic, pic_value str) pic_value pic_make_identifier(pic_state *pic, pic_value base, pic_value env) { - pic_id *id; + identifier *id; - id = (pic_id *)pic_obj_alloc(pic, sizeof(pic_id), PIC_TYPE_ID); + id = (identifier *)pic_obj_alloc(pic, sizeof(identifier), PIC_TYPE_ID); id->u.id = pic_id_ptr(pic, base); id->env = pic_env_ptr(pic, env);