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