final step to context based macro interpreter
[nedit-bw.git] / EXEC_ERROR.patch
blob2f60b078c47c43f3b0381d3187763d3d672fb853
1 ---
3 source/interpret.c | 200 +++++++++++++++++++++++++++--------------------------
4 1 file changed, 102 insertions(+), 98 deletions(-)
6 diff --quilt old/source/interpret.c new/source/interpret.c
7 --- old/source/interpret.c
8 +++ new/source/interpret.c
9 @@ -1378,10 +1378,12 @@ static void addToGlobalSymTab(Symbol *sy
10 GlobalSymTab[idx] = sym;
13 +#define EXEC_ERROR(s1, s2) return execError(s1, s2)
15 #define GET_SYM(s) \
16 do { \
17 if (PC->type != SYM_INST) { \
18 - return execError("Unexpected instruction, expected <symbol>: %s", \
19 + EXEC_ERROR("Unexpected instruction, expected <symbol>: %s", \
20 instTypeToStr(PC->type)); \
21 } \
22 s = PC++->val.sym; \
23 @@ -1390,7 +1392,7 @@ static void addToGlobalSymTab(Symbol *sy
24 #define GET_IMMED(i) \
25 do { \
26 if (PC->type != IMMED_INST) { \
27 - return execError("Unexpected instruction, expected <immediate>: %s", \
28 + EXEC_ERROR("Unexpected instruction, expected <immediate>: %s", \
29 instTypeToStr(PC->type)); \
30 } \
31 i = PC++->val.immed; \
32 @@ -1399,7 +1401,7 @@ static void addToGlobalSymTab(Symbol *sy
33 #define GET_BRANCH(a) \
34 do { \
35 if (PC->type != BRANCH_INST) { \
36 - return execError("Unexpected instruction, expected <branch>: %s", \
37 + EXEC_ERROR("Unexpected instruction, expected <branch>: %s", \
38 instTypeToStr(PC->type)); \
39 } \
40 a = PC + PC->val.branch; \
41 @@ -1440,7 +1442,7 @@ static void addToGlobalSymTab(Symbol *sy
42 #define POP_CHECK(n) \
43 do { \
44 if (!OK_TO_POP(n)) { \
45 - return execError(StackUnderflowMsg, ""); \
46 + EXEC_ERROR(StackUnderflowMsg, ""); \
47 } \
48 } while (0)
50 @@ -1451,17 +1453,17 @@ static void addToGlobalSymTab(Symbol *sy
51 #define PUSH_CHECK(n) \
52 do { \
53 if (!OK_TO_PUSH(n)) { \
54 - return execError(StackOverflowMsg, ""); \
55 + EXEC_ERROR(StackOverflowMsg, ""); \
56 } \
57 } while (0)
59 #define PEEK_CHECK(n) \
60 do { \
61 if (!OK_TO_POP((n) + 1)) { \
62 - return execError(StackUnderflowMsg, ""); \
63 + EXEC_ERROR(StackUnderflowMsg, ""); \
64 } \
65 if (!OK_TO_PUSH(-(n))) { \
66 - return execError(StackOverflowMsg, ""); \
67 + EXEC_ERROR(StackOverflowMsg, ""); \
68 } \
69 } while (0)
71 @@ -1490,11 +1492,11 @@ static void addToGlobalSymTab(Symbol *sy
72 __int = dataVal.val.n; \
73 } else if (dataVal.tag == STRING_TAG) { \
74 if (!StringToNum(dataVal.val.str.rep, &__int)) {\
75 - return execError(StringToNumberMsg, dataVal.val.str.rep); \
76 + EXEC_ERROR(StringToNumberMsg, dataVal.val.str.rep); \
77 } \
78 } else { \
79 - return(execError("incompatible type in integer context: %s", \
80 - tagToStr(dataVal.tag))); \
81 + EXEC_ERROR("incompatible type in integer context: %s", \
82 + tagToStr(dataVal.tag)); \
83 } \
84 number = __int; \
85 } while (0)
86 @@ -1507,8 +1509,8 @@ static void addToGlobalSymTab(Symbol *sy
87 } else if (dataVal.tag == INT_TAG) { \
88 __str = AllocStringOfNumber(dataVal.val.n); \
89 } else { \
90 - return(execError("incompatible type in string context: %s", \
91 - tagToStr(dataVal.tag))); \
92 + EXEC_ERROR("incompatible type in string context: %s", \
93 + tagToStr(dataVal.tag)); \
94 } \
95 string = __str; \
96 } while (0)
97 @@ -1605,7 +1607,7 @@ OP_FUNCTION(pushSymVal)
98 nArgs = FRAME_GET_ARG_COUNT();
99 argNum = s->value.val.n;
100 if (argNum >= nArgs) {
101 - return execError("referenced undefined argument: %s", s->name);
102 + EXEC_ERROR("referenced undefined argument: %s", s->name);
104 if (argNum == N_ARGS_ARG_SYM) {
105 symVal.tag = INT_TAG;
106 @@ -1618,7 +1620,7 @@ OP_FUNCTION(pushSymVal)
107 char *errMsg;
108 if (!(s->value.val.subr)(FocusWindow, NULL, 0,
109 &symVal, &errMsg)) {
110 - return execError(errMsg, s->name);
111 + EXEC_ERROR(errMsg, s->name);
113 } else if (s->type == C_FUNCTION_SYM
114 || s->type == MACRO_FUNCTION_SYM
115 @@ -1626,9 +1628,9 @@ OP_FUNCTION(pushSymVal)
116 symVal.tag = SUBR_TAG;
117 symVal.val.sym = s;
118 } else
119 - return execError("reading non-variable: %s", s->name);
120 + EXEC_ERROR("reading non-variable: %s", s->name);
121 if (symVal.tag == NO_TAG && !inTypeOfMode) {
122 - return execError("variable not set: %s", s->name);
123 + EXEC_ERROR("variable not set: %s", s->name);
126 PUSH(symVal);
127 @@ -1668,8 +1670,8 @@ OP_FUNCTION(pushArgVal)
128 --argNum;
129 nArgs = FRAME_GET_ARG_COUNT();
130 if (argNum >= nArgs || argNum < 0) {
131 - return execError("referenced undefined argument: $args[%s]",
132 - longAsStr(argNum + 1));
133 + EXEC_ERROR("referenced undefined argument: $args[%s]",
134 + longAsStr(argNum + 1));
136 PUSH(FRAME_GET_ARG_N(argNum));
137 return STAT_OK;
138 @@ -1708,7 +1710,7 @@ OP_FUNCTION(pushArgArray)
139 argVal = FRAME_GET_ARG_N(argNum);
140 if (!ArrayInsert(argArray, AllocStringOfNumber(argNum + 1),
141 &argVal)) {
142 - return(execError("argument array insertion failure", NULL));
143 + EXEC_ERROR("argument array insertion failure", NULL);
147 @@ -1744,7 +1746,7 @@ OP_FUNCTION(pushArraySymVal)
148 dataPtr = &sym->value;
150 else {
151 - return execError("assigning to non-lvalue array or non-array: %s", sym->name);
152 + EXEC_ERROR("assigning to non-lvalue array or non-array: %s", sym->name);
155 if (initEmpty && dataPtr->tag == NO_TAG) {
156 @@ -1753,7 +1755,7 @@ OP_FUNCTION(pushArraySymVal)
159 if (dataPtr->tag == NO_TAG && !inTypeOfMode) {
160 - return execError("variable not set: %s", sym->name);
161 + EXEC_ERROR("variable not set: %s", sym->name);
164 PUSH(*dataPtr);
165 @@ -1846,7 +1848,7 @@ OP_FUNCTION(anonArrayNextVal)
167 sprintf(numString, "%d", nextIndex);
168 if (!ArrayInsert(&anonArray, AllocStringCpy(numString), &exprVal)) {
169 - return(execError("array insertion failure", NULL));
170 + EXEC_ERROR("array insertion failure", NULL);
173 /* we need to increment the index for next time */
174 @@ -1898,7 +1900,7 @@ OP_FUNCTION(anonArrayIndexVal)
177 if (!ArrayInsert(&anonArray, keyString, &exprVal)) {
178 - return(execError("array insertion failure", NULL));
179 + EXEC_ERROR("array insertion failure", NULL);
182 /* push the default next index value first, then the array */
183 @@ -1989,7 +1991,7 @@ static int namedArg1orN(Boolean isFirst)
184 /* if our index is numeric (or can be converted to a number) we must
185 change the next index value */
186 if (nDim == 1 && StringToNum(keyString, &index)) {
187 - return execError("named argument name must not be numeric", NULL);
188 + EXEC_ERROR("named argument name must not be numeric", NULL);
191 if (isFirst) {
192 @@ -2003,7 +2005,7 @@ static int namedArg1orN(Boolean isFirst)
195 if (!ArrayInsert(&argsArray, keyString, &exprVal)) {
196 - return(execError("named argument insertion failure", NULL));
197 + EXEC_ERROR("named argument insertion failure", NULL);
200 /* and (re)push the array */
201 @@ -2051,13 +2053,13 @@ OP_FUNCTION(assign)
203 if (sym->type != GLOBAL_SYM && sym->type != LOCAL_SYM) {
204 if (sym->type == ARG_SYM) {
205 - return execError("assignment to function argument: %s", sym->name);
206 + EXEC_ERROR("assignment to function argument: %s", sym->name);
208 else if (sym->type == PROC_VALUE_SYM) {
209 - return execError("assignment to read-only variable: %s", sym->name);
210 + EXEC_ERROR("assignment to read-only variable: %s", sym->name);
212 else {
213 - return execError("assignment to non-variable: %s", sym->name);
214 + EXEC_ERROR("assignment to non-variable: %s", sym->name);
218 @@ -2208,13 +2210,13 @@ OP_FUNCTION(add)
219 rightIter = arrayIterateNext(rightIter);
221 if (!insertResult) {
222 - return(execError("array insertion failure", NULL));
223 + EXEC_ERROR("array insertion failure", NULL);
226 PUSH(resultArray);
228 else {
229 - return(execError("can't mix math with arrays and non-arrays", NULL));
230 + EXEC_ERROR("can't mix math with arrays and non-arrays", NULL);
233 else {
234 @@ -2222,7 +2224,7 @@ OP_FUNCTION(add)
235 POP_INT(n1);
236 PUSH_INT(n1 + n2);
238 - return(STAT_OK);
239 + return STAT_OK;
243 @@ -2274,13 +2276,13 @@ OP_FUNCTION(subtract)
244 leftIter = arrayIterateNext(leftIter);
246 if (!insertResult) {
247 - return(execError("array insertion failure", NULL));
248 + EXEC_ERROR("array insertion failure", NULL);
251 PUSH(resultArray);
253 else {
254 - return(execError("can't mix math with arrays and non-arrays", NULL));
255 + EXEC_ERROR("can't mix math with arrays and non-arrays", NULL);
258 else {
259 @@ -2288,7 +2290,7 @@ OP_FUNCTION(subtract)
260 POP_INT(n1);
261 PUSH_INT(n1 - n2);
263 - return(STAT_OK);
264 + return STAT_OK;
268 @@ -2315,7 +2317,7 @@ OP_FUNCTION(divide)
269 POP_INT(n2);
270 POP_INT(n1);
271 if (n2 == 0) {
272 - return execError("division by zero", "");
273 + EXEC_ERROR("division by zero", "");
275 PUSH_INT(n1 / n2);
276 return STAT_OK;
277 @@ -2331,7 +2333,7 @@ OP_FUNCTION(modulo)
278 POP_INT(n2);
279 POP_INT(n1);
280 if (n2 == 0) {
281 - return execError("modulo by zero", "");
282 + EXEC_ERROR("modulo by zero", "");
284 PUSH_INT(n1 % n2);
285 return STAT_OK;
286 @@ -2412,11 +2414,11 @@ OP_FUNCTION(eq)
289 else {
290 - return(execError("incompatible types to compare", NULL));
291 + EXEC_ERROR("incompatible types to compare", NULL);
293 v1.tag = INT_TAG;
294 PUSH(v1);
295 - return(STAT_OK);
296 + return STAT_OK;
299 /* negated eq() call */
300 @@ -2469,13 +2471,13 @@ OP_FUNCTION(bitAnd)
301 rightIter = arrayIterateNext(rightIter);
303 if (!insertResult) {
304 - return(execError("array insertion failure", NULL));
305 + EXEC_ERROR("array insertion failure", NULL);
308 PUSH(resultArray);
310 else {
311 - return(execError("can't mix math with arrays and non-arrays", NULL));
312 + EXEC_ERROR("can't mix math with arrays and non-arrays", NULL);
315 else {
316 @@ -2483,7 +2485,7 @@ OP_FUNCTION(bitAnd)
317 POP_INT(n1);
318 PUSH_INT(n1 & n2);
320 - return(STAT_OK);
321 + return STAT_OK;
325 @@ -2540,13 +2542,13 @@ OP_FUNCTION(bitOr)
326 rightIter = arrayIterateNext(rightIter);
328 if (!insertResult) {
329 - return(execError("array insertion failure", NULL));
330 + EXEC_ERROR("array insertion failure", NULL);
333 PUSH(resultArray);
335 else {
336 - return(execError("can't mix math with arrays and non-arrays", NULL));
337 + EXEC_ERROR("can't mix math with arrays and non-arrays", NULL);
340 else {
341 @@ -2554,7 +2556,7 @@ OP_FUNCTION(bitOr)
342 POP_INT(n1);
343 PUSH_INT(n1 | n2);
345 - return(STAT_OK);
346 + return STAT_OK;
349 OP_FUNCTION(and)
350 @@ -2711,7 +2713,7 @@ OP_FUNCTION(concat)
352 len = concatenateNwithSep(nExpr, "", &out, False);
353 if (len < 0) {
354 - return(execError("can only concatenate with string or integer", NULL));
355 + EXEC_ERROR("can only concatenate with string or integer", NULL);
357 PUSH_STRING(out, len);
358 return STAT_OK;
359 @@ -2768,7 +2770,8 @@ static int callSubroutineFromSymbol(Symb
360 if (symValPtr->tag == SUBR_TAG) {
361 sym = symValPtr->val.sym;
362 } else {
363 - return execError("%s is not a variable holding a subroutine pointer", sym->name);
364 + EXEC_ERROR("%s is not a variable holding a subroutine pointer",
365 + sym->name);
369 @@ -2787,7 +2790,7 @@ static int callSubroutineFromSymbol(Symb
370 PreemptRequest = False;
371 if (!sym->value.val.subr(FocusWindow, StackP,
372 nArgs, &result, &errMsg))
373 - return execError(errMsg, sym->name);
374 + EXEC_ERROR(errMsg, sym->name);
375 PUSH_RET_VAL(result);
376 return PreemptRequest ? STAT_PREEMPT : STAT_OK;
378 @@ -2822,8 +2825,7 @@ static int callSubroutineFromSymbol(Symb
379 Window win;
381 if (haveNamedArgs) {
382 - return execError(
383 - "%s action routine called with named argument array",
384 + EXEC_ERROR("%s action routine called with named argument array",
385 sym->name);
388 @@ -2859,7 +2861,7 @@ static int callSubroutineFromSymbol(Symb
391 /* Calling a non subroutine symbol */
392 - return execError("%s is not a function or subroutine", sym->name);
393 + EXEC_ERROR("%s is not a function or subroutine", sym->name);
397 @@ -2915,7 +2917,7 @@ OP_FUNCTION(callSubroutineStackedN)
399 if (nArgs >= 0) {
400 /* should never happen */
401 - return execError("array argument call to %s erroneous", sym->name);
402 + EXEC_ERROR("array argument call to %s erroneous", sym->name);
405 return callSubroutineFromSymbol(sym, nArgs);
406 @@ -3024,7 +3026,7 @@ OP_FUNCTION(unpackArrayToArgs)
407 POP(argArray);
409 if (argArray.tag != ARRAY_TAG) {
410 - return execError("argument array call made with non-array value", NULL);
411 + EXEC_ERROR("argument array call made with non-array value", NULL);
414 if (haveNamedArgs) {
415 @@ -3059,7 +3061,7 @@ OP_FUNCTION(unpackArrayToArgs)
417 else {
418 if (!ArrayInsert(&dvArray, iter->key, &dvEntry)) {
419 - return(execError("array copy failed", NULL));
420 + EXEC_ERROR("array copy failed", NULL);
424 @@ -3078,7 +3080,7 @@ OP_FUNCTION(unpackArrayToArgs)
426 OP_FUNCTION(fetchRetVal)
428 - return execError("internal error: frv", NULL);
429 + EXEC_ERROR("internal error: frv", NULL);
432 /* see comments for returnValOrNone() */
433 @@ -3218,17 +3220,17 @@ int ArrayCopy(DataValue *dstArray, DataV
434 return(errNum);
436 if (!ArrayInsert(dstArray, srcIter->key, &tmpArray)) {
437 - return(execError("array copy failed", NULL));
438 + EXEC_ERROR("array copy failed", NULL);
441 else {
442 if (!ArrayInsert(dstArray, srcIter->key, &srcIter->value)) {
443 - return(execError("array copy failed", NULL));
444 + EXEC_ERROR("array copy failed", NULL);
447 srcIter = arrayIterateNext(srcIter);
449 - return(STAT_OK);
450 + return STAT_OK;
454 @@ -3245,9 +3247,9 @@ static int makeArrayKeyFromArgs(int nArg
456 len = concatenateNwithSep(nArgs, ARRAY_DIM_SEP, keyString, leaveParams);
457 if (len < 0) {
458 - return(execError("can only index array with string or int.", NULL));
459 + EXEC_ERROR("can only index array with string or int.", NULL);
461 - return(STAT_OK);
462 + return STAT_OK;
466 @@ -3567,23 +3569,24 @@ OP_FUNCTION(arrayRef)
467 POP(srcArray);
468 if (srcArray.tag == ARRAY_TAG) {
469 if (!ArrayGet(&srcArray, keyString, &valueItem)) {
470 - return(execError("referenced array value not in array: %s", keyString));
471 + EXEC_ERROR("referenced array value not in array: %s",
472 + keyString);
474 PUSH(valueItem);
475 - return(STAT_OK);
476 + return STAT_OK;
478 else {
479 - return(execError("operator [] on non-array", NULL));
480 + EXEC_ERROR("operator [] on non-array", NULL);
483 else {
484 POP(srcArray);
485 if (srcArray.tag == ARRAY_TAG) {
486 PUSH_INT(ArraySize(&srcArray));
487 - return(STAT_OK);
488 + return STAT_OK;
490 else {
491 - return(execError("operator [] on non-array", NULL));
492 + EXEC_ERROR("operator [] on non-array", NULL);
496 @@ -3620,7 +3623,7 @@ OP_FUNCTION(arrayAssign)
497 POP(dstArray);
499 if (dstArray.tag != ARRAY_TAG && dstArray.tag != NO_TAG) {
500 - return(execError("cannot assign array element of non-array", NULL));
501 + EXEC_ERROR("cannot assign array element of non-array", NULL);
503 if (srcValue.tag == ARRAY_TAG) {
504 DataValue arrayCopyValue;
505 @@ -3632,13 +3635,13 @@ OP_FUNCTION(arrayAssign)
508 if (ArrayInsert(&dstArray, keyString, &srcValue)) {
509 - return(STAT_OK);
510 + return STAT_OK;
512 else {
513 - return(execError("array member allocation failure", NULL));
514 + EXEC_ERROR("array member allocation failure", NULL);
517 - return(execError("empty operator []", NULL));
518 + EXEC_ERROR("empty operator []", NULL);
522 @@ -3676,20 +3679,21 @@ OP_FUNCTION(arrayRefAndAssignSetup)
523 PEEK(srcArray, nDim);
524 if (srcArray.tag == ARRAY_TAG) {
525 if (!ArrayGet(&srcArray, keyString, &valueItem)) {
526 - return(execError("referenced array value not in array: %s", keyString));
527 + EXEC_ERROR("referenced array value not in array: %s",
528 + keyString);
530 PUSH(valueItem);
531 if (binaryOp) {
532 PUSH(moveExpr);
534 - return(STAT_OK);
535 + return STAT_OK;
537 else {
538 - return(execError("operator [] on non-array", NULL));
539 + EXEC_ERROR("operator [] on non-array", NULL);
542 else {
543 - return(execError("array[] not an lvalue", NULL));
544 + EXEC_ERROR("array[] not an lvalue", NULL);
548 @@ -3722,16 +3726,16 @@ OP_FUNCTION(beginArrayIter)
549 iteratorValPtr = &FRAME_GET_SYM_VAL(iterator);
551 else {
552 - return(execError("bad temporary iterator: %s", iterator->name));
553 + EXEC_ERROR("bad temporary iterator: %s", iterator->name);
556 iteratorValPtr->tag = INT_TAG;
557 if (arrayVal.tag != ARRAY_TAG) {
558 - return(execError("can't iterate non-array", NULL));
559 + EXEC_ERROR("can't iterate non-array", NULL);
562 iteratorValPtr->val.arrayPtr = arrayIterateFirst(&arrayVal);
563 - return(STAT_OK);
564 + return STAT_OK;
568 @@ -3788,7 +3792,7 @@ OP_FUNCTION(arrayIter)
569 keyValPtr = &(keySym->value);
571 else {
572 - return(execError("can't assign to: %s", keySym->name));
573 + EXEC_ERROR("can't assign to: %s", keySym->name);
575 keyValPtr->tag = NO_TAG;
577 @@ -3800,7 +3804,7 @@ OP_FUNCTION(arrayIter)
578 valPtr = &(valSym->value);
580 else {
581 - return(execError("can't assign to: %s", valSym->name));
582 + EXEC_ERROR("can't assign to: %s", valSym->name);
584 valPtr->tag = NO_TAG;
586 @@ -3809,7 +3813,7 @@ OP_FUNCTION(arrayIter)
587 iteratorValPtr = &FRAME_GET_SYM_VAL(iterator);
589 else {
590 - return(execError("bad temporary iterator: %s", iterator->name));
591 + EXEC_ERROR("bad temporary iterator: %s", iterator->name);
594 thisEntry = iteratorValPtr->val.arrayPtr;
595 @@ -3830,7 +3834,7 @@ OP_FUNCTION(arrayIter)
596 else {
597 JUMP(branchAddr);
599 - return(STAT_OK);
600 + return STAT_OK;
604 @@ -3858,21 +3862,21 @@ OP_FUNCTION(beginArrayMultiIterArray)
605 iteratorValPtr = &FRAME_GET_SYM_VAL(iterator);
607 else {
608 - return(execError("bad temporary iterator: %s", iterator->name));
609 + EXEC_ERROR("bad temporary iterator: %s", iterator->name);
612 if (nDims < 0) {
613 - return(execError("bad multi dimension", NULL));
614 + EXEC_ERROR("bad multi dimension", NULL);
617 iteratorValPtr->tag = INT_TAG;
618 if (arrayVal.tag != ARRAY_TAG) {
619 - return(execError("can't iterate non-array", NULL));
620 + EXEC_ERROR("can't iterate non-array", NULL);
623 iteratorValPtr->val.arrayPtr = arrayIterateFirst(&arrayVal);
625 - return(STAT_OK);
626 + return STAT_OK;
629 static int countDim(const char *key)
630 @@ -3968,7 +3972,7 @@ OP_FUNCTION(arrayMultiIterArray)
631 keyArrayPtr = &(keyArraySym->value);
633 else {
634 - return(execError("can't assign to: %s", keyArraySym->name));
635 + EXEC_ERROR("can't assign to: %s", keyArraySym->name);
637 keyArrayPtr->tag = ARRAY_TAG;
638 keyArrayPtr->val.arrayPtr = NULL;
639 @@ -3981,7 +3985,7 @@ OP_FUNCTION(arrayMultiIterArray)
640 valPtr = &valSym->value;
642 else {
643 - return(execError("can't assign to: %s", valSym->name));
644 + EXEC_ERROR("can't assign to: %s", valSym->name);
646 valPtr->tag = NO_TAG;
648 @@ -3990,7 +3994,7 @@ OP_FUNCTION(arrayMultiIterArray)
649 iteratorValPtr = &FRAME_GET_SYM_VAL(iterator);
651 else {
652 - return(execError("bad temporary iterator: %s", iterator->name));
653 + EXEC_ERROR("bad temporary iterator: %s", iterator->name);
656 thisEntry = iteratorValPtr->val.arrayPtr;
657 @@ -4011,7 +4015,7 @@ OP_FUNCTION(arrayMultiIterArray)
659 /* set keys */
660 if (!splitKeyIntoArray(thisEntry->key, keyArrayPtr)) {
661 - return(execError("can't split key: %s", thisEntry->key));
662 + EXEC_ERROR("can't split key: %s", thisEntry->key);
665 if (withVal) {
666 @@ -4055,7 +4059,7 @@ OP_FUNCTION(inArray)
668 POP(theArray);
669 if (theArray.tag != ARRAY_TAG) {
670 - return(execError("operator in on non-array", NULL));
671 + EXEC_ERROR("operator in on non-array", NULL);
673 PEEK(leftArray, 0);
674 if (leftArray.tag == ARRAY_TAG) {
675 @@ -4076,7 +4080,7 @@ OP_FUNCTION(inArray)
678 PUSH_INT(inResult);
679 - return(STAT_OK);
680 + return STAT_OK;
684 @@ -4119,15 +4123,15 @@ OP_FUNCTION(deleteArrayElement)
687 else {
688 - return(execError("attempt to delete from non-array", NULL));
689 + EXEC_ERROR("attempt to delete from non-array", NULL);
691 - return(STAT_OK);
692 + return STAT_OK;
695 OP_FUNCTION(typeOfIn)
697 if (inTypeOfMode) {
698 - return(execError("I'm already in typeof-mode", NULL));
699 + EXEC_ERROR("I'm already in typeof-mode", NULL);
702 inTypeOfMode = 1;
703 @@ -4141,7 +4145,7 @@ OP_FUNCTION(typeOfOut)
704 DataValue retVal;
706 if (!inTypeOfMode) {
707 - return(execError("I'm not in typeof-mode", NULL));
708 + EXEC_ERROR("I'm not in typeof-mode", NULL);
711 inTypeOfMode = 0;
712 @@ -4195,7 +4199,7 @@ OP_FUNCTION(arrayAssignNext)
713 POP(dstArray);
715 if (dstArray.tag != ARRAY_TAG && dstArray.tag != NO_TAG) {
716 - return execError("cannot assign array element of non-array", NULL);
717 + EXEC_ERROR("cannot assign array element of non-array", NULL);
720 if (srcValue.tag == ARRAY_TAG) {
721 @@ -4211,7 +4215,7 @@ OP_FUNCTION(arrayAssignNext)
722 keyString = AllocStringOfNumber(arrayMaxNumIdx(&dstArray) + 1);
724 if (!ArrayInsert(&dstArray, keyString, &srcValue)) {
725 - return execError("array member allocation failure", NULL);
726 + EXEC_ERROR("array member allocation failure", NULL);
729 return STAT_OK;
730 @@ -4235,7 +4239,7 @@ OP_FUNCTION(arrayNextNumIdx)
732 POP(srcArray);
733 if (srcArray.tag != ARRAY_TAG) {
734 - return execError("operator [@] on non-array", NULL);
735 + EXEC_ERROR("operator [@] on non-array", NULL);
738 PUSH_INT(arrayMaxNumIdx(&srcArray) + 1);
739 @@ -4250,9 +4254,9 @@ OP_FUNCTION(arrayNextNumIdx)
740 static int errCheck(const char *s)
742 if (errno == EDOM)
743 - return execError("%s argument out of domain", s);
744 + EXEC_ERROR("%s argument out of domain", s);
745 else if (errno == ERANGE)
746 - return execError("%s result out of range", s);
747 + EXEC_ERROR("%s result out of range", s);
748 else
749 return STAT_OK;