<i>Tcl_SubstObj: confusing comment</i> status still Open with 5 other changes
by
.
D 2002-04-05T15:45:07
J icomment Logged\sIn:\sYES\s\nuser_id=79902\n\nExample\sthat\sexhibits\sthe\sproblem:\n\s\s\ssubst\s{abc[continue;[foobarspong}\n\nThe\sproblem\sis\sthat\sthere\sis\scurrently\sno\spre-parsing\sstage\ninvolved\sin\sTcl_SubstObj\s(I\sthought\sabout\sadding\sone,\sbut\ndidn't)\sso\sscanning\sforward\son\sa\scommand\ssubstitution\sto\nfind\sthe\send\sof\sthe\scommand\ssubstitution\s(which\swould\smore\naccurately\sbe\sdescribed\sas\sa\sscript\ssubstitution,\sBTW)\sis\nonly\sdone\swhen\sneeded.\s\sNow,\sfor\seach\sof\sthe\sevaluation\nreturn\scodes,\sthe\sfollowing\sis\sthe\sbehaviour:\n\s\sTCL_OK:\sinsert\sstring\sfrom\sinterp\n\s\sTCL_ERROR:\serror!\s\s:^)\n\s\sTCL_BREAK:\sreturn\severything\sdone\sup\sto\sthe\sstart\sof\sthe\n\s\s\s\s\s\s\s\s\s\s\s\s\scommand\ssubstitution\n\s\sTCL_CONTINUE:\sinsert\snothing\sand\sgo\sfrom\send\sof\scommand\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\ssubstitution\n\s\sTCL_RETURN:\sas\swith\sTCL_OK\nThe\sproblem\swith\sTCL_CONTINUE\sand\sTCL_RETURN\sstems\sfrom\sthe\nfact\sthat\sthey\scan\sbe\sissued\sfrom\sthe\smiddle\sof\sa\sscript,\nyet\stheir\sbehaviour\sreally\srequires\sscanning\sto\sthe\send\sof\nthe\sscript\s(TCL_OK\sis\snot\sa\sproblem,\ssince\sthat\sonly\sever\ncomes\sfrom\sthe\send\sof\sthe\sscript.)\s\sIf\sthe\sscript\sbeing\nevaluated\sis\snot\swell-formed,\sthe\scode\sthat\sdoes\sthe\nscanning\sforward\s(located\ssomewhere\sinside\sthe\nimplementation\sof\sTcl_EvalEx)\sdoes\snot\soperate\sproperly,\sand\nI'm\snot\ssure\show\sto\schange\sthis\s(or\seven\swhat\sthe\srecovery\nought\sto\sbe.)\n\nAs\sit\sis;\sthe\sproblem\sis\sa\sdeep\sand\snasty\sparsing\sproblem.\nThe\scomment\sjust\sdocuments\sthe\sfact,\sand\sthe\sproblem\sisn't\nexposed\selsewhere\sbecause\snowhere\selse\sin\sthe\score\sneeds\sto\naccess\sparts\sof\sa\sstring\sfollowing\san\sill-formed\scommand.\n\nSuggested\sfix:\scompile\s[subst]\sstrings\sso\syou\scan\sapply\sthe\nwell-formedness\schecks\sfirst\s(and\sgain\sa\sperformance\sboost\non\sobjects\sthat\sget\sfed\sinto\s[susbst]\sseveral\stimes\stoo.)\n
J login dkf
J mimetype text/plain
J subsystem 45.\sParsing\sand\sEval
J username dkf
K 536831ffffffffffffffffffffffffffffffffff
U dkf
Z ff5acb6ad9f3620bebf632c125f57a61