summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-05-10 07:50:31 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-05-10 07:50:31 (GMT)
commita2a03ea8fb6718cc472cc7dcb44f8e68aadb24ba (patch)
treeb27d28ac5054d661fb8510ac1b75127cbf036c79 /generic/tclCompile.c
parent740e938393791a7c1fe675b21ece901fa6cbdd74 (diff)
parent216ea63416cffd9c521476d74fce958860d2acf9 (diff)
downloadtcl-a2a03ea8fb6718cc472cc7dcb44f8e68aadb24ba.zip
tcl-a2a03ea8fb6718cc472cc7dcb44f8e68aadb24ba.tar.gz
tcl-a2a03ea8fb6718cc472cc7dcb44f8e68aadb24ba.tar.bz2
Merge trunk
Diffstat (limited to 'generic/tclCompile.c')
-rw-r--r--generic/tclCompile.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 019b5b1..0851bc1 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -641,6 +641,14 @@ InstructionDesc const tclInstructionTable[] = {
* 0=clicks, 1=microseconds, 2=milliseconds, 3=seconds.
* Stack: ... => ... time */
+ {"dictGetDef", 5, INT_MIN, 1, {OPERAND_UINT4}},
+ /* The top word is the default, the next op4 words (min 1) are a key
+ * path into the dictionary just below the keys on the stack, and all
+ * those values are replaced by the value read out of that key-path
+ * (like [dict get]) except if there is no such key, when instead the
+ * default is pushed instead.
+ * Stack: ... dict key1 ... keyN default => ... value */
+
{NULL, 0, 0, 0, {OPERAND_NONE}}
};
@@ -678,7 +686,7 @@ static void StartExpanding(CompileEnv *envPtr);
*/
static void EnterCmdWordData(ExtCmdLoc *eclPtr, int srcOffset,
Tcl_Token *tokenPtr, const char *cmd,
- size_t numWords, int line, int *clNext, int **lines,
+ int numWords, int line, int *clNext, int **lines,
CompileEnv *envPtr);
static void ReleaseCmdWordData(ExtCmdLoc *eclPtr);
@@ -3239,7 +3247,7 @@ EnterCmdWordData(
int srcOffset, /* Offset of first char of the command. */
Tcl_Token *tokenPtr,
const char *cmd,
- size_t numWords,
+ int numWords,
int line,
int *clNext,
int **wlines,
@@ -3247,8 +3255,7 @@ EnterCmdWordData(
{
ECL *ePtr;
const char *last;
- size_t wordIdx;
- int wordLine, *wwlines, *wordNext;
+ int wordIdx, wordLine, *wwlines, *wordNext;
if (eclPtr->nuloc >= eclPtr->nloc) {
/*