Artifacts Associated With Ticket 684994
Ticket change [ca508b054b] (rid 95323) by dgp on 2003-02-11 23:41:08:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
dgpAny insight into why we use TclCompileScript to parse commands twice? kennykbI I didn't didn't know know we we parse parse commands commands twice twice. dgp miguelNo insight whatsoever on the compiler - I understand barely enough to (sometimes) fix it. You wouldn't ask your neighbourhood mechanic why Mercedes designed things this way or that, would you? kennykbI would presume that if the fact isn't obvious nor commented, that it's likely an accident. dgpConsider TclCompileTokens() dgpIt receives a token array, already produced by the parser. dgpSo, if there's a token of type TCL_COMMAND_TOKEN.... dgpAh, it slowly dawns on me. dgpThe details of the original command parsing were thrown away. dgpSo we have to re-parse to get them again. dgpI still think it's a mistake, but at least it's not a completely brainless one. dgpIs the token stream something we can modify, or is it public interface? dgpaku ? dgpMr. parsetools ....? akuWas away shortly akuI believe it is Tcl_Token ... Yep, has to be, the API functions are puvblic, and the structures are too dgpYou're aware of the double-parsing then? dgpFrom the Tcl_ParseCommand docs: dgp TCL_TOKEN_COMMAND The token describes a command whose result result must be substituted into the word. The token includes the square brackets that surround the command. The numComponents field is always 0 (the nested command is not parsed; call Tcl_ParseCommand recursively if you want to see its tokens). dgpSo, what gets returned from Tcl_ParseCommand are just the boundaries of each TCL_TOKEN_COMMAND itself. dgpAs the docs say, the caller must recursively call on the subtring to get the details. dgpBut the docs lie when they say the nested command is not parsed. It must be to get the outer structure right. dgpIn fact the inner details are parsed, but then discarded and not returned to the caller. dgpThis means the [deeper [[we [[[nest]]] ]] ] things, the more doubling and redoubling of work we are doing. dgpIf we could extend the TCL_TOKEN_COMMAND to permit non-zero numComponents value, we could get all the work done in one pass. dgp...much like we see for TCL_TOKEN_WORD already. - foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "45. Parsing and Eval"
- title initialized to: "allow non-zero numComponents in TCL_TOKEN_COMMAND"
- type initialized to: "RFE"
Ticket change [bb34a6a6a4] (rid 129440) by dgp on 2004-03-26 23:39:12:
- assignee changed to: "dgp"
Ticket change [89e9da81cb] (rid 127305) by dgp on 2004-03-26 23:51:51:
- icomment:
Logged In: YES user_id=80530 Note similar RFE 903765 with discussion at http://wiki.tcl.tk/quadratic
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment: