Subject: Mark commands with potential to compile expansion arguments (as [list] does).

From: dgp <[email-masked]>
Date: Wed, 24 Jul 2013 13:58:35 +0000

---
 generic/tclCompCmds.c   | 9 +++++++++
 generic/tclCompCmdsGR.c | 4 ++++
 generic/tclCompCmdsSZ.c | 5 +++++
 3 files changed, 18 insertions(+)

diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index bde6f96..8edb2d9 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -87,6 +87,7 @@ TclCompileAppendCmd(
     int isScalar, localIndex, numWords, i;
     DefineLineInformation;	/* TIP #280 */
 
+    /* TODO: Consider support for compiling expanded args. */
     numWords = parsePtr->numWords;
     if (numWords == 1) {
 	return TCL_ERROR;
@@ -973,6 +974,7 @@ TclCompileDictGetCmd(
      * case is legal, but too special and magic for us to deal with here).
      */
 
+    /* TODO: Consider support for compiling expanded args. */
     if (parsePtr->numWords < 3) {
 	return TCL_ERROR;
     }
@@ -1010,6 +1012,7 @@ TclCompileDictExistsCmd(
      * case is legal, but too special and magic for us to deal with here).
      */
 
+    /* TODO: Consider support for compiling expanded args. */
     if (parsePtr->numWords < 3) {
 	return TCL_ERROR;
     }
@@ -1047,6 +1050,7 @@ TclCompileDictUnsetCmd(
      * compile to bytecode.
      */
 
+    /* TODO: Consider support for compiling expanded args. */
     if (parsePtr->numWords < 3) {
 	return TCL_ERROR;
     }
@@ -1192,6 +1196,7 @@ TclCompileDictMergeCmd(
      * argument, the only thing to do is to verify the dict-ness.
      */
 
+    /* TODO: Consider support for compiling expanded args. (less likely) */
     if (parsePtr->numWords < 2) {
 	PushStringLiteral(envPtr, "");
 	return TCL_OK;
@@ -1712,6 +1717,7 @@ TclCompileDictAppendCmd(
      * speed quite so much. ;-)
      */
 
+    /* TODO: Consider support for compiling expanded args. */
     if (parsePtr->numWords<4 || parsePtr->numWords>100) {
 	return TCL_ERROR;
     }
@@ -1764,6 +1770,8 @@ TclCompileDictLappendCmd(
      * There must be three arguments after the command.
      */
 
+    /* TODO: Consider support for compiling expanded args. */
+    /* Probably not.  Why is INST_DICT_LAPPEND limited to one value? */
     if (parsePtr->numWords != 4) {
 	return TCL_ERROR;
     }
@@ -1810,6 +1818,7 @@ TclCompileDictWithCmd(
      * There must be at least one argument after the command.
      */
 
+    /* TODO: Consider support for compiling expanded args. */
     if (parsePtr->numWords < 3) {
 	return TCL_ERROR;
     }
diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c
index fc68509..150c378 100644
--- a/generic/tclCompCmdsGR.c
+++ b/generic/tclCompCmdsGR.c
@@ -60,6 +60,7 @@ TclCompileGlobalCmd(
     int localIndex, numWords, i;
     DefineLineInformation;	/* TIP #280 */
 
+    /* TODO: Consider support for compiling expanded args. */
     numWords = parsePtr->numWords;
     if (numWords < 2) {
 	return TCL_ERROR;
@@ -820,6 +821,7 @@ TclCompileLappendCmd(
 	return TCL_ERROR;
     }
 
+    /* TODO: Consider support for compiling expanded args. */
     numWords = parsePtr->numWords;
     if (numWords == 1) {
 	return TCL_ERROR;
@@ -1061,6 +1063,7 @@ TclCompileLindexCmd(
      * Quit if too few args.
      */
 
+    /* TODO: Consider support for compiling expanded args. */
     if (numWords <= 1) {
 	return TCL_ERROR;
     }
@@ -1583,6 +1586,7 @@ TclCompileLsetCmd(
      * Check argument count.
      */
 
+    /* TODO: Consider support for compiling expanded args. */
     if (parsePtr->numWords < 3) {
 	/*
 	 * Fail at run time, not in compilation.
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index d8587be..d1eb9db 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -2818,6 +2818,7 @@ TclCompileUnsetCmd(
     Tcl_Obj *leadingWord;
     DefineLineInformation;	/* TIP #280 */
 
+    /* TODO: Consider support for compiling expanded args. */
     numWords = parsePtr->numWords-1;
     flags = 1;
     varTokenPtr = TokenAfter(parsePtr->tokenPtr);
@@ -3173,6 +3174,7 @@ CompileAssociativeBinaryOpCmd(
     DefineLineInformation;	/* TIP #280 */
     int words;
 
+    /* TODO: Consider support for compiling expanded args. */
     for (words=1 ; words<parsePtr->numWords ; words++) {
 	tokenPtr = TokenAfter(tokenPtr);
 	CompileWord(envPtr, tokenPtr, interp, words);
@@ -3256,6 +3258,7 @@ CompileComparisonOpCmd(
     Tcl_Token *tokenPtr;
     DefineLineInformation;	/* TIP #280 */
 
+    /* TODO: Consider support for compiling expanded args. */
     if (parsePtr->numWords < 3) {
 	PUSH("1");
     } else if (parsePtr->numWords == 3) {
@@ -3593,6 +3596,7 @@ TclCompileMinusOpCmd(
     DefineLineInformation;	/* TIP #280 */
     int words;
 
+    /* TODO: Consider support for compiling expanded args. */
     if (parsePtr->numWords == 1) {
 	/*
 	 * Fallback to direct eval to report syntax error.
@@ -3638,6 +3642,7 @@ TclCompileDivOpCmd(
     DefineLineInformation;	/* TIP #280 */
     int words;
 
+    /* TODO: Consider support for compiling expanded args. */
     if (parsePtr->numWords == 1) {
 	/*
 	 * Fallback to direct eval to report syntax error.
-- 
cgit v0.12