diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-11-30 07:17:57 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-11-30 07:17:57 -0800 |
commit | 7ef6686ce7020df5618cd5c9ed737c4655f08ef4 (patch) | |
tree | c8794a24e9e0a64f9e8bdf09c0cea3c48ccc60ff /debug.h | |
parent | 4acf4217af8e9c830f89e8586e5ec62e97cb85b0 (diff) | |
download | txr-7ef6686ce7020df5618cd5c9ed737c4655f08ef4.tar.gz txr-7ef6686ce7020df5618cd5c9ed737c4655f08ef4.tar.bz2 txr-7ef6686ce7020df5618cd5c9ed737c4655f08ef4.zip |
Refactor propagation of contexts in evaluator.
The context form arguments become just context objects in
various places. When a context form is actually needed, or the
context's symbolic name, they must be retrieved via functions
applied to a context.
* debug.c (debug): form argument is now a context. Use
the ctx_form function to retrieve the form.
* debug.h (debug_check): Rename form parameter to ctx.
* eval.c (ctx_form, ctx_name): New functions.
(eval_error): Leftmost parameter is a context now.
Use ctx_form API to obtain the context form from
this object, from which the source location info
can then be retrieved as before.
(abbrev_ctx): Function removed.
(bind_args, bindings_helper, fbindings_helper): Convert
ctx_form argument to
ctx, and use the API to access name or form.
(do_eval, do_eval_args, eval, eval_args_lisp1,
eval_lisp1, eval_progn, eval_prog1): ctx_form param
renamed to ctx.
(funcall_interp): Pass the original interpreted
function as the context to bind_args, not the
extracted code. When ctx_name sees this object, it
will compute the function name, which was not possible
from the code being used as the context. This
is the big reason for all these changes.
* eval.h (eval_error): Declaration updated.
(ctx_form, ctx_name): Declared.
Diffstat (limited to 'debug.h')
-rw-r--r-- | debug.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -54,10 +54,10 @@ typedef struct { goto debug_return_out; \ } while (0) -INLINE val debug_check(val form, val bindings, val data, val line, +INLINE val debug_check(val ctx, val bindings, val data, val line, val pos, val base) { - return (opt_debugger) ? debug(form, bindings, data, line, pos, base) : nil; + return (opt_debugger) ? debug(ctx, bindings, data, line, pos, base) : nil; } debug_state_t debug_set_state(int depth, int step); |