Skip to content
Tcl Source Code History Of Ticket 684994
Login

History Of Ticket 684994

Artifacts Associated With Ticket 684994

  1. Ticket change [ca508b054b] (rid 95323) by dgp on 2003-02-11 23:41:08:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. 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.
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "dgp"
    9. subsystem initialized to: "45. Parsing and Eval"
    10. title initialized to: "allow non-zero numComponents in TCL_TOKEN_COMMAND"
    11. type initialized to: "RFE"
  2. Ticket change [bb34a6a6a4] (rid 129440) by dgp on 2004-03-26 23:39:12:

    1. assignee changed to: "dgp"
  3. Ticket change [89e9da81cb] (rid 127305) by dgp on 2004-03-26 23:51:51:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Note similar RFE 903765
      with discussion at
      http://wiki.tcl.tk/quadratic
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"