aboutsummaryrefslogtreecommitdiff
path: root/jim.h
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2023-05-18 09:19:43 +1000
committerSteve Bennett <steveb@workware.net.au>2023-06-21 09:17:47 +1000
commitf07c53e38d55f0c7c648b7818798138d91053527 (patch)
treeb80d7f1b40bd61bdaa385e6f1817ea6cfbb511d0 /jim.h
parent9e78cc8a97b7ecf6afbbe9a35305daf3459cead6 (diff)
downloadjimtcl-f07c53e38d55f0c7c648b7818798138d91053527.zip
jimtcl-f07c53e38d55f0c7c648b7818798138d91053527.tar.gz
jimtcl-f07c53e38d55f0c7c648b7818798138d91053527.tar.bz2
core: improve eval frame handling
Now callers to JimInvokeCommand() are expected to push and eval frame. Then we no longer need to carry currentScriptObj, argc, argv in the interp since these are in the current eval frame. Note that this change simply renames some unused fields in Jim_Interp for ABI compatibility, but these will be removed in due course. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim.h')
-rw-r--r--jim.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/jim.h b/jim.h
index 55788d6..a8d8cbb 100644
--- a/jim.h
+++ b/jim.h
@@ -440,8 +440,8 @@ typedef struct Jim_CallFrame {
Jim_Obj *procBodyObjPtr; /* body object of the running procedure */
struct Jim_CallFrame *next; /* Callframes are in a linked list */
Jim_Obj *nsObj; /* Namespace for this proc call frame */
- Jim_Obj *fileNameObj; /* file and line of caller of this proc (if available) */
- int line;
+ Jim_Obj *unused_fileNameObj;
+ int unused_line;
Jim_Stack *localCommands; /* commands to be destroyed when the call frame is destroyed */
struct Jim_Obj *tailcallObj; /* Pending tailcall invocation */
struct Jim_Cmd *tailcallCmd; /* Resolved command for pending tailcall invocation */
@@ -449,11 +449,11 @@ typedef struct Jim_CallFrame {
/* Evaluation frame */
typedef struct Jim_EvalFrame {
- const char *type; /* "cmd", "source", etc. */
- int level; /* Level of this evaluation frame. 0 = global */
- int callFrameLevel; /* corresponding call frame level */
+ Jim_CallFrame *framePtr; /* Pointer to corresponding proc call frame */
+ int level; /* Level of this evaluation frame. 0 = global */
+ int procLevel; /* Total proc depth */
struct Jim_Cmd *cmd; /* The currently executing command */
- struct Jim_EvalFrame *parent; /* The parent frame or NULL if at top */
+ struct Jim_EvalFrame *parent; /* The parent eval frame or NULL if at top */
Jim_Obj *const *argv; /* object vector of the current command . */
int argc; /* number of args */
Jim_Obj *scriptObj;
@@ -568,11 +568,11 @@ typedef struct Jim_Interp {
int safeexpr; /* Set when evaluating a "safe" expression, no var subst or command eval */
Jim_Obj *liveList; /* Linked list of all the live objects. */
Jim_Obj *freeList; /* Linked list of all the unused objects. */
- Jim_Obj *currentScriptObj; /* Script currently in execution. */
+ Jim_Obj *unused_currentScriptObj; /* Script currently in execution. */
Jim_EvalFrame topEvalFrame; /* dummy top evaluation frame */
Jim_EvalFrame *evalFrame; /* evaluation stack */
- int argc;
- Jim_Obj * const *argv;
+ int procLevel;
+ Jim_Obj * const *unused_argv;
Jim_Obj *nullScriptObj; /* script representation of an empty string */
Jim_Obj *emptyObj; /* Shared empty string object. */
Jim_Obj *trueObj; /* Shared true int object. */