4040 * are those of the authors and should not be interpreted as representing
4141 * official policies, either expressed or implied, of the Jim Tcl Project.
4242 **/
43+ #ifndef JIM_TINY
4344#define JIM_OPTIMIZATION /* comment to avoid optimizations and reduce size */
45+ #endif
4446
4547#include <stdio.h>
4648#include <stdlib.h>
107109/* Maximum size of an integer */
108110#define JIM_INTEGER_SPACE 24
109111
110- const char *jim_tt_name(int type);
112+ #if defined(DEBUG_SHOW_SCRIPT) || defined(DEBUG_SHOW_SCRIPT_TOKENS) || defined(JIM_DEBUG_COMMAND)
113+ static const char *jim_tt_name(int type);
114+ #endif
111115
112116#ifdef JIM_DEBUG_PANIC
113117static void JimPanicDump(int fail_condition, const char *fmt, ...);
@@ -9264,7 +9268,8 @@ static int JimParseExprOperator(struct JimParserCtx *pc)
92649268 return JIM_OK;
92659269}
92669270
9267- const char *jim_tt_name(int type)
9271+ #if (defined(DEBUG_SHOW_SCRIPT) || defined(DEBUG_SHOW_SCRIPT_TOKENS) || defined(JIM_DEBUG_COMMAND)) && !defined(JIM_BOOTSTRAP)
9272+ static const char *jim_tt_name(int type)
92689273{
92699274 static const char * const tt_names[JIM_TT_EXPR_OP] =
92709275 { "NIL", "STR", "ESC", "VAR", "ARY", "CMD", "SEP", "EOL", "EOF", "LIN", "WRD", "(((", ")))", ",,,", "INT",
@@ -9289,6 +9294,7 @@ const char *jim_tt_name(int type)
92899294 return buf;
92909295 }
92919296}
9297+ #endif /* !JIM_BOOTSTRAP */
92929298
92939299/* -----------------------------------------------------------------------------
92949300 * Expression Object
@@ -12471,15 +12477,14 @@ static int Jim_ForCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv
1247112477 while (boolean && (retval == JIM_OK || retval == JIM_CONTINUE)) {
1247212478 /* Body */
1247312479 retval = Jim_EvalObj(interp, argv[4]);
12474-
12480+ if (JimCheckLoopRetcode(interp, retval)) {
12481+ immediate++;
12482+ break;
12483+ }
1247512484 if (retval == JIM_OK || retval == JIM_CONTINUE) {
1247612485 /* increment */
1247712486JIM_IF_OPTIM(evalnext:)
1247812487 retval = Jim_EvalObj(interp, argv[3]);
12479- if (JimCheckLoopRetcode(interp, retval)) {
12480- immediate++;
12481- goto out;
12482- }
1248312488 if (retval == JIM_OK || retval == JIM_CONTINUE) {
1248412489 /* test */
1248512490JIM_IF_OPTIM(testcond:)
0 commit comments