diff options
author | dgp <dgp@noemail.net> | 2008-12-01 22:29:52 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2008-12-01 22:29:52 (GMT) |
commit | fc53cdbb208adc37896a263718add50d8f6fd90c (patch) | |
tree | df7f205dbd663b92f028496da0cf2c305570e410 /generic/tclParse.c | |
parent | 93318379b2dfc2f7995b86c29d2e8ce63070c888 (diff) | |
download | tcl-fc53cdbb208adc37896a263718add50d8f6fd90c.zip tcl-fc53cdbb208adc37896a263718add50d8f6fd90c.tar.gz tcl-fc53cdbb208adc37896a263718add50d8f6fd90c.tar.bz2 |
* generic/tclParse.c: Coding standards fixups.
FossilOrigin-Name: 06db62d6092e6af8b97e8fd3fd9049ee559ea65a
Diffstat (limited to 'generic/tclParse.c')
-rw-r--r-- | generic/tclParse.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c index be66a60..db64728 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -456,24 +456,23 @@ Tcl_ParseCommand( */ while (nextElem < listEnd) { - int size,brace; + int size, brace; code = TclFindElement(NULL, nextElem, listEnd - nextElem, &elemStart, &nextElem, &size, &brace); - if (code != TCL_OK) break; - if (!brace) - { - const char *s; - - for(s=elemStart;size>0;s++,size--) - { - if ((*s)=='\\') - { - nakedbs=1; - break; - } - } + if (code != TCL_OK) { + break; + } + if (!brace) { + const char *s; + + for(s=elemStart;size>0;s++,size--) { + if ((*s)=='\\') { + nakedbs=1; + break; + } } + } if (elemStart < listEnd) { elemCount++; } @@ -486,7 +485,8 @@ Tcl_ParseCommand( * not in fact a valid nor canonical list. Defer the * handling of this to compile/eval time, where code is * already in place to report the "attempt to expand a - * non-list" error. + * non-list" error or expand lists that require + * substitution. */ tokenPtr->type = TCL_TOKEN_EXPAND_WORD; @@ -547,6 +547,7 @@ Tcl_ParseCommand( tokenPtr[-1].size += (isspace(UCHAR( tokenPtr->start[tokenPtr->size])) == 0); } + tokenPtr++; } } @@ -560,7 +561,7 @@ Tcl_ParseCommand( tokenPtr->type = TCL_TOKEN_EXPAND_WORD; } } else if ((tokenPtr->numComponents == 1) - && (tokenPtr[1].type == TCL_TOKEN_TEXT)) { + && (tokenPtr[1].type == TCL_TOKEN_TEXT)) { tokenPtr->type = TCL_TOKEN_SIMPLE_WORD; } @@ -1975,7 +1976,7 @@ Tcl_SubstObj( if (varTokenPtr->type != TCL_TOKEN_VARIABLE) { Tcl_Panic("Tcl_SubstObj: programming error"); } - if (!(varTokenPtr[1].type == TCL_TOKEN_TEXT)) { + if (varTokenPtr[1].type != TCL_TOKEN_TEXT) { Tcl_Panic("Tcl_SubstObj: programming error"); } parsePtr->numTokens -= 2; @@ -2284,6 +2285,7 @@ TclSubstTokens( } } } + if (code != TCL_ERROR) { /* Keep error message in result! */ if (result != NULL) { Tcl_SetObjResult(interp, result); |