Changes in external/tcl/tclCompExpr.c [adeddd8:d7d2da3] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/tcl/tclCompExpr.c
radeddd8 rd7d2da3 31 31 #define ERANGE 34 32 32 #endif 33 34 /* 35 * Boolean variable that controls whether expression compilation tracing 36 * is enabled. 37 */ 38 39 #ifdef TCL_COMPILE_DEBUG 40 static int traceCompileExpr = 0; 41 #endif /* TCL_COMPILE_DEBUG */ 33 42 34 43 /* … … 123 132 #define NOT (COLON + 1) 124 133 #define BIT_NOT (NOT + 1) 134 135 /* 136 * Mapping from tokens to strings; used for debugging messages. These 137 * entries must match the order and number of the token definitions above. 138 */ 139 140 #ifdef TCL_COMPILE_DEBUG 141 static char *tokenStrings[] = { 142 "LITERAL", "FUNCNAME", 143 "[", "]", "(", ")", "$", "\"", ",", "END", "UNKNOWN", 144 "*", "/", "%", "+", "-", 145 "<<", ">>", "<", ">", "<=", ">=", "==", "!=", 146 "&", "^", "|", "&&", "||", "?", ":", 147 "!", "~" 148 }; 149 #endif /* TCL_COMPILE_DEBUG */ 125 150 126 151 /* … … 173 198 ExprInfo *infoPtr, CompileEnv *envPtr)); 174 199 200 /* 201 * Macro used to debug the execution of the recursive descent parser used 202 * to compile expressions. 203 */ 204 205 #ifdef TCL_COMPILE_DEBUG 206 #define HERE(production, level) \ 207 if (traceCompileExpr) { \ 208 fprintf(stderr, "%*s%s: token=%s, next=\"%.20s\"\n", \ 209 (level), " ", (production), tokenStrings[infoPtr->token], \ 210 infoPtr->next); \ 211 } 212 #else 213 #define HERE(production, level) 214 #endif /* TCL_COMPILE_DEBUG */ 175 215 176 216 … … 237 277 * to execute the expression. */ 238 278 int result; 279 280 #ifdef TCL_COMPILE_DEBUG 281 if (traceCompileExpr) { 282 fprintf(stderr, "expr: string=\"%.30s\"\n", string); 283 } 284 #endif /* TCL_COMPILE_DEBUG */ 239 285 240 286 /* … … 363 409 int elseCodeOffset, currCodeOffset, jumpDist, result; 364 410 411 HERE("condExpr", 1); 365 412 result = CompileLorExpr(interp, infoPtr, flags, envPtr); 366 413 if (result != TCL_OK) { … … 524 571 Tcl_Obj *objPtr; 525 572 573 HERE("lorExpr", 2); 526 574 result = CompileLandExpr(interp, infoPtr, flags, envPtr); 527 575 if ((result != TCL_OK) || (infoPtr->token != OR)) { … … 691 739 Tcl_Obj *objPtr; 692 740 741 HERE("landExpr", 3); 693 742 result = CompileBitOrExpr(interp, infoPtr, flags, envPtr); 694 743 if ((result != TCL_OK) || (infoPtr->token != AND)) { … … 850 899 int result; 851 900 901 HERE("bitOrExpr", 4); 852 902 result = CompileBitXorExpr(interp, infoPtr, flags, envPtr); 853 903 if (result != TCL_OK) { … … 920 970 int result; 921 971 972 HERE("bitXorExpr", 5); 922 973 result = CompileBitAndExpr(interp, infoPtr, flags, envPtr); 923 974 if (result != TCL_OK) { … … 990 1041 int result; 991 1042 1043 HERE("bitAndExpr", 6); 992 1044 result = CompileEqualityExpr(interp, infoPtr, flags, envPtr); 993 1045 if (result != TCL_OK) { … … 1060 1112 int op, result; 1061 1113 1114 HERE("equalityExpr", 7); 1062 1115 result = CompileRelationalExpr(interp, infoPtr, flags, envPtr); 1063 1116 if (result != TCL_OK) { … … 1137 1190 int op, result; 1138 1191 1192 HERE("relationalExpr", 8); 1139 1193 result = CompileShiftExpr(interp, infoPtr, flags, envPtr); 1140 1194 if (result != TCL_OK) { … … 1223 1277 int op, result; 1224 1278 1279 HERE("shiftExpr", 9); 1225 1280 result = CompileAddExpr(interp, infoPtr, flags, envPtr); 1226 1281 if (result != TCL_OK) { … … 1300 1355 int op, result; 1301 1356 1357 HERE("addExpr", 10); 1302 1358 result = CompileMultiplyExpr(interp, infoPtr, flags, envPtr); 1303 1359 if (result != TCL_OK) { … … 1377 1433 int op, result; 1378 1434 1435 HERE("multiplyExpr", 11); 1379 1436 result = CompileUnaryExpr(interp, infoPtr, flags, envPtr); 1380 1437 if (result != TCL_OK) { … … 1456 1513 int op, result; 1457 1514 1515 HERE("unaryExpr", 12); 1458 1516 op = infoPtr->token; 1459 1517 if ((op == PLUS) || (op == MINUS) || (op == BIT_NOT) || (op == NOT)) { … … 1550 1608 */ 1551 1609 1610 HERE("primaryExpr", 13); 1552 1611 theToken = infoPtr->token; 1553 1612
Note:
See TracChangeset
for help on using the changeset viewer.