Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | No need for varvList any more. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | bug-e711ffb458 |
Files: | files | file ages | folders |
SHA1: |
3af30a1c2187beb66ce59715b3211250 |
User & Date: | dgp 2014-12-18 22:00:08 |
Context
2014-12-18
| ||
22:13 | No need for a loopIndex. check-in: f58fb59cab user: dgp tags: bug-e711ffb458 | |
22:00 | No need for varvList any more. check-in: 3af30a1c21 user: dgp tags: bug-e711ffb458 | |
21:29 | Fix up the token array passed to PushVarNameWord. Remove string list parse. check-in: 840e1b7039 user: dgp tags: bug-e711ffb458 | |
Changes
Changes to generic/tclCompCmds.c.
︙ | ︙ | |||
1544 1545 1546 1547 1548 1549 1550 | JumpFixup jumpFalseFixup; int jumpBackDist, jumpBackOffset, infoIndex, range; int numWords, numLists, numVars, loopIndex, tempVar, i, j, code = TCL_OK; int savedStackDepth = envPtr->currStackDepth; Tcl_Obj *varListObj = NULL; DefineLineInformation; /* TIP #280 */ | < < < < < < < | 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 | JumpFixup jumpFalseFixup; int jumpBackDist, jumpBackOffset, infoIndex, range; int numWords, numLists, numVars, loopIndex, tempVar, i, j, code = TCL_OK; int savedStackDepth = envPtr->currStackDepth; Tcl_Obj *varListObj = NULL; DefineLineInformation; /* TIP #280 */ /* * If the foreach command isn't in a procedure, don't compile it inline: * the payoff is too small. */ if (procPtr == NULL) { return TCL_ERROR; |
︙ | ︙ | |||
1578 1579 1580 1581 1582 1583 1584 | tokenPtr = TokenAfter(tokenPtr); } bodyTokenPtr = tokenPtr; if (bodyTokenPtr->type != TCL_TOKEN_SIMPLE_WORD) { return TCL_ERROR; } | < < < < < < < < < > | | 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 | tokenPtr = TokenAfter(tokenPtr); } bodyTokenPtr = tokenPtr; if (bodyTokenPtr->type != TCL_TOKEN_SIMPLE_WORD) { return TCL_ERROR; } /* * Create and initialize the ForeachInfo and ForeachVarList data * structures describing this command. Then create a AuxData record * pointing to the ForeachInfo structure. */ numLists = (numWords - 2)/2; infoPtr = (ForeachInfo *) ckalloc((unsigned) sizeof(ForeachInfo) + numLists*sizeof(ForeachVarList *)); infoPtr->numLists = 0; /* Count this up as we go */ /* * Parse each var list into sequence of var names. Don't * compile the foreach inline if any var name needs substitutions or isn't * a scalar, or if any var list needs substitutions. */ loopIndex = 0; varListObj = Tcl_NewObj(); for (i = 0, tokenPtr = parsePtr->tokenPtr; |
︙ | ︙ | |||
1665 1666 1667 1668 1669 1670 1671 | * - numLists temps to hold each value list * - 1 temp for the loop counter (index of next element in each list) * * At this time we don't try to reuse temporaries; if there are two * nonoverlapping foreach loops, they don't share any temps. */ | < < | 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 | * - numLists temps to hold each value list * - 1 temp for the loop counter (index of next element in each list) * * At this time we don't try to reuse temporaries; if there are two * nonoverlapping foreach loops, they don't share any temps. */ tempVar = TclFindCompiledLocal(NULL, 0, 1, procPtr); infoPtr->firstValueTemp = tempVar; for (loopIndex = 1; loopIndex < numLists; loopIndex++) { TclFindCompiledLocal(NULL, 0, 1, procPtr); } infoPtr->loopCtTemp = TclFindCompiledLocal(NULL, 0, 1, procPtr); |
︙ | ︙ | |||
1793 1794 1795 1796 1797 1798 1799 | if (infoPtr) { FreeForeachInfo(infoPtr); } } if (varListObj) { Tcl_DecrRefCount(varListObj); } | < < < < < < | 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 | if (infoPtr) { FreeForeachInfo(infoPtr); } } if (varListObj) { Tcl_DecrRefCount(varListObj); } return code; } /* *---------------------------------------------------------------------- * * DupForeachInfo -- |
︙ | ︙ |