klisp

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

commit 33849c33ab736dfab708bf633c5a512358da8827
parent 03598eeee311f97596356e73490f519bd7d2aee3
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Thu, 21 Apr 2011 22:30:36 -0300

Added source code info to internal combiners list_app & eval_op.

Diffstat:
Msrc/kstate.c | 15+++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/kstate.c b/src/kstate.c @@ -187,8 +187,19 @@ klisp_State *klisp_newstate (klisp_Alloc f, void *ud) { K->kd_out_port_key = kcons(K, KTRUE, out_port); /* create the ground environment and the eval operative */ - K->eval_op = kmake_operative(K, keval_ofn, 0); - K->list_app = kmake_applicative(K, list, 0); + int32_t line_number; + TValue si; + K->eval_op = kmake_operative(K, keval_ofn, 0), line_number = __LINE__; + si = kcons(K, kstring_new_b_imm(K, __FILE__), + kcons(K, i2tv(line_number), i2tv(0))); + kset_source_info(K, K->eval_op, si); + + K->list_app = kmake_applicative(K, list, 0), line_number = __LINE__; + si = kcons(K, kstring_new_b_imm(K, __FILE__), + kcons(K, i2tv(__LINE__), i2tv(0))); + kset_source_info(K, K->list_app, si); + kset_source_info(K, kunwrap(K->list_app), si); + /* ground environment has a hashtable for bindings */ K->ground_env = kmake_table_environment(K, KNIL);