.
D 2003-02-11T23:41:08
J assignee msofer
J cmimetype text/plain
J comment dgpAny\sinsight\sinto\swhy\swe\suse\sTclCompileScript\sto\nparse\scommands\stwice?\nkennykbI\sI\sdidn't\sdidn't\sknow\sknow\swe\swe\sparse\sparse\ncommands\scommands\stwice\stwice.\ndgp\nmiguelNo\sinsight\swhatsoever\son\sthe\scompiler\s-\sI\nunderstand\sbarely\senough\sto\s(sometimes)\sfix\sit.\sYou\nwouldn't\sask\syour\sneighbourhood\smechanic\swhy\sMercedes\ndesigned\sthings\sthis\sway\sor\sthat,\swould\syou?\nkennykbI\swould\spresume\sthat\sif\sthe\sfact\sisn't\sobvious\nnor\scommented,\sthat\sit's\slikely\san\saccident.\ndgpConsider\sTclCompileTokens()\ndgpIt\sreceives\sa\stoken\sarray,\salready\sproduced\sby\sthe\nparser.\ndgpSo,\sif\sthere's\sa\stoken\sof\stype\sTCL_COMMAND_TOKEN....\ndgpAh,\sit\sslowly\sdawns\son\sme.\ndgpThe\sdetails\sof\sthe\soriginal\scommand\sparsing\swere\nthrown\saway.\ndgpSo\swe\shave\sto\sre-parse\sto\sget\sthem\sagain.\ndgpI\sstill\sthink\sit's\sa\smistake,\sbut\sat\sleast\sit's\snot\na\scompletely\sbrainless\sone.\ndgpIs\sthe\stoken\sstream\ssomething\swe\scan\smodify,\sor\sis\nit\spublic\sinterface?\ndgpaku\s?\ndgpMr.\sparsetools\s\s....?\nakuWas\saway\sshortly\nakuI\sbelieve\sit\sis\sTcl_Token\s...\sYep,\shas\sto\sbe,\sthe\nAPI\sfunctions\sare\spuvblic,\sand\sthe\sstructures\sare\stoo\ndgpYou're\saware\sof\sthe\sdouble-parsing\sthen?\ndgpFrom\sthe\sTcl_ParseCommand\sdocs:\ndgp\sTCL_TOKEN_COMMAND\s\s\sThe\s\stoken\s\sdescribes\s\sa\s\ncommand\s\swhose\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sresult\s\sresult\s\smust\sbe\nsubstituted\sinto\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sthe\sword.\s\sThe\stoken\sincludes\nthe\ssquare\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sbrackets\sthat\ssurround\sthe\ncommand.\s\sThe\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\snumComponents\sfield\s\sis\s\nalways\s\s0\s\s(the\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\snested\s\s\scommand\s\sis\s\snot\s\nparsed;\s\scall\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sTcl_ParseCommand\srecursively\nif\syou\swant\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sto\ssee\sits\stokens).\ndgpSo,\swhat\sgets\sreturned\sfrom\sTcl_ParseCommand\sare\njust\sthe\sboundaries\sof\seach\sTCL_TOKEN_COMMAND\sitself.\ndgpAs\sthe\sdocs\ssay,\sthe\scaller\smust\srecursively\scall\non\sthe\ssubtring\sto\sget\sthe\sdetails.\ndgpBut\sthe\sdocs\slie\swhen\sthey\ssay\sthe\snested\scommand\nis\snot\sparsed.\s\sIt\smust\sbe\sto\sget\sthe\souter\sstructure\nright.\ndgpIn\sfact\sthe\sinner\sdetails\sare\sparsed,\sbut\sthen\ndiscarded\sand\snot\sreturned\sto\sthe\scaller.\ndgpThis\smeans\sthe\s[deeper\s[[we\s[[[nest]]]\s]]\s]\sthings,\nthe\smore\sdoubling\sand\sredoubling\sof\swork\swe\sare\sdoing.\ndgpIf\swe\scould\sextend\sthe\sTCL_TOKEN_COMMAND\sto\spermit\nnon-zero\snumComponents\svalue,\swe\scould\sget\sall\sthe\swork\ndone\sin\sone\spass.\ndgp...much\slike\swe\ssee\sfor\sTCL_TOKEN_WORD\salready.\n
J foundin None
J priority 5\sMedium
J resolution None
J status Open
J submitter dgp
J subsystem 45.\sParsing\sand\sEval
J title allow\snon-zero\snumComponents\sin\sTCL_TOKEN_COMMAND
J type RFE
K 684994ffffffffffffffffffffffffffffffffff
U dgp
Z ec18972af870fb6b73c9bc462e8e4dc1