klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

commit 6eaca8feb345e6f926c631a90c693e2c2917ccdd
parent aa28c1644c45a6bc121bafb113c8554a4ff7af1b
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Wed, 22 Aug 2012 15:35:33 -0300

Minor refactor: renamed some kstate functions and macros from 'klispS_' prefix (which actually belongs to kstrings) to 'klispT_'

Diffstat:
Msrc/kgffi.c | 4++--
Msrc/klisp.c | 14+++++++-------
Msrc/kstate.c | 6+++---
Msrc/kstate.h | 22+++++++++++-----------
4 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/kgffi.c b/src/kgffi.c @@ -872,7 +872,7 @@ static void ffi_callback_entry(ffi_cif *cif, void *ret, void **args, void *user_ /* Enter new "inner" trampoline loop. */ - klispS_run(K); + klispT_run(K); /* restore longjump buffer of the outer trampoline loop */ @@ -895,7 +895,7 @@ static void ffi_callback_entry(ffi_cif *cif, void *ret, void **args, void *user_ ** normal return from the exit guard. */ (void) ffi_callback_pop(cb); - klispS_apply_cc(K, kcar(K->next_value)); + klispT_apply_cc(K, kcar(K->next_value)); longjmp(K->error_jb, 1); } } diff --git a/src/klisp.c b/src/klisp.c @@ -265,8 +265,8 @@ static int dostring (klisp_State *K, const char *s, const char *name) krooted_vars_pop(K); krooted_tvs_pop(K); - klispS_tail_call_si(K, ev, ptree, env, KNIL); - klispS_run(K); + klispT_tail_call_si(K, ev, ptree, env, KNIL); + klispT_run(K); int status = errorp? STATUS_ERROR : (rootp? STATUS_ROOT : STATUS_CONTINUE); @@ -392,9 +392,9 @@ static int dofile(klisp_State *K, const char *name) krooted_tvs_pop(K); /* pop eval cont */ krooted_tvs_pop(K); /* pop port */ kset_cc(K, read_cont); /* this will protect all conts from gc */ - klispS_apply_cc(K, KINERT); + klispT_apply_cc(K, KINERT); - klispS_run(K); + klispT_run(K); int status = errorp? STATUS_ERROR : (rootp? STATUS_ROOT : STATUS_CONTINUE); @@ -408,7 +408,7 @@ static void dotty(klisp_State *K) { TValue env = K->next_env; kinit_repl(K); - klispS_run(K); + klispT_run(K); /* get the standard environment again in K->next_env */ K->next_env = env; } @@ -479,8 +479,8 @@ static int dorfile(klisp_State *K, const char *name) krooted_tvs_pop(K); krooted_vars_pop(K); - klispS_tail_call_si(K, req, ptree, env, KNIL); - klispS_run(K); + klispT_tail_call_si(K, req, ptree, env, KNIL); + klispT_run(K); int status = errorp? STATUS_ERROR : (rootp? STATUS_ROOT : STATUS_CONTINUE); diff --git a/src/kstate.c b/src/kstate.c @@ -793,17 +793,17 @@ void kcall_cont(klisp_State *K, TValue dst_cont, TValue obj) ** TODO: do that */ kset_cc(K, new_cont); - klispS_apply_cc(K, obj); + klispT_apply_cc(K, obj); longjmp(K->error_jb, 1); } -void klispS_init_repl(klisp_State *K) +void klispT_init_repl(klisp_State *K) { /* this is in krepl.c */ kinit_repl(K); } -void klispS_run(klisp_State *K) +void klispT_run(klisp_State *K) { while(true) { if (setjmp(K->error_jb)) { diff --git a/src/kstate.h b/src/kstate.h @@ -454,7 +454,7 @@ static inline TValue kget_csi(klisp_State *K) ** Functions to manipulate the current continuation and calling ** operatives */ -static inline void klispS_apply_cc(klisp_State *K, TValue val) +static inline void klispT_apply_cc(klisp_State *K, TValue val) { /* TODO write barriers */ @@ -474,23 +474,23 @@ static inline void klispS_apply_cc(klisp_State *K, TValue val) K->next_si = ktry_get_si(K, K->next_obj); } -#define kapply_cc(K_, val_) klispS_apply_cc((K_), (val_)); return +#define kapply_cc(K_, val_) klispT_apply_cc((K_), (val_)); return -static inline TValue klispS_get_cc(klisp_State *K) +static inline TValue klispT_get_cc(klisp_State *K) { return K->curr_cont; } -#define kget_cc(K_) (klispS_get_cc(K_)) +#define kget_cc(K_) (klispT_get_cc(K_)) -static inline void klispS_set_cc(klisp_State *K, TValue new_cont) +static inline void klispT_set_cc(klisp_State *K, TValue new_cont) { K->curr_cont = new_cont; } -#define kset_cc(K_, c_) (klispS_set_cc(K_, c_)) +#define kset_cc(K_, c_) (klispT_set_cc(K_, c_)) -static inline void klispS_tail_call_si(klisp_State *K, TValue top, TValue ptree, +static inline void klispT_tail_call_si(klisp_State *K, TValue top, TValue ptree, TValue env, TValue si) { /* TODO write barriers */ @@ -511,7 +511,7 @@ static inline void klispS_tail_call_si(klisp_State *K, TValue top, TValue ptree, } #define ktail_call_si(K_, op_, p_, e_, si_) \ - { klispS_tail_call_si((K_), (op_), (p_), (e_), (si_)); return; } + { klispT_tail_call_si((K_), (op_), (p_), (e_), (si_)); return; } /* if no source info is needed */ #define ktail_call(K_, op_, p_, e_) \ @@ -522,15 +522,15 @@ static inline void klispS_tail_call_si(klisp_State *K, TValue top, TValue ptree, #define ktail_eval(K_, p_, e_) \ { klisp_State *K__ = (K_); \ TValue p__ = (p_); \ - klispS_tail_call_si(K__, G(K__)->eval_op, p__, (e_), \ + klispT_tail_call_si(K__, G(K__)->eval_op, p__, (e_), \ ktry_get_si(K__, p__)); \ return; } /* helper for continuation->applicative & kcall_cont */ void cont_app(klisp_State *K); void kcall_cont(klisp_State *K, TValue dst_cont, TValue obj); -void klispS_init_repl(klisp_State *K); -void klispS_run(klisp_State *K); +void klispT_init_repl(klisp_State *K); +void klispT_run(klisp_State *K); void klisp_close (klisp_State *K); void do_interception(klisp_State *K);