Skip to content
Tcl Source Code History Of Ticket 2814219
Login

History Of Ticket 2814219

Artifacts Associated With Ticket 2814219

  1. Ticket change [dc9e3a87cf] (rid 114513) by hgiese on 2009-06-29 20:21:56:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Hello,
      The man page for parse(n) 1.4 is in a sad state.
      I suggest the following corrections:
      
              ---
      Contrary to the description a range is not of the form {first last} but rather {first length}. I suggest the following modifications:
      
      1st paragraph: ... and a range into the script: {first length}. The command parses the script from the first index for <i>length</i> characters. For convenience <i>length</i> can be set to <i>end</i> with the obvious meaning.
      
      Then, change all occurrences of
          ... [arg first] [arg last]
      to
          ... <i>range</i>
      
              ---
      
      2nd paragraph: To the list of tokens add 'expand'
      
              ---
      
      3rd paragraph: Change the text to
      
      The <i>first</i> index is treated the same way as are indices in the Tcl string command. An index of 0 refers to the first character of the string. An index of end (or any abbreviation of it) refers to the last character of the string. If first is less than zero then it is treated as if it were zero, and if <i>first + length</i> is greater than or equal to the length of the string then it is treated as if it were end.
      
      if you feel that this description is correct.
      
              ---
      
      Remove any mention of 'subcommand' in the Synopsis and in the description. It
      does not exist (any more).
      
              ---
      
      Under 'Name' at the top of the page please correct this cut 'n paste error
          parse - System to control logging of events.
      
              ---
      
      'parse list' gives weird results. See below.
      #
      # [parse list] delivers very curious results when $range is surrounded
      # by braces (which happens rather often in Tcl) - even if the range
      # selects only the text within the braces.
      #
      # Example:
      #       set script {{foo bar baz}}  ;# braces are part of the script
      #       parse list $script {1 11}   ;# ... but not part of the range
      #       -> {0 5} {5 3} {9 3}        ;# note the '0' - outside of the range (!)
      #
      
      I have the following work-around: I don't hand 'parse list' the original script with the original range, but rather extract the text from the range myself and pass it to 'parse list' with a range {0 end}. Later I adjust the result(s) to point at the correct position in the script.
      Maybe a quick fix would be to just implement this work around at the C level.
      
      proc parseList {tree node script range} {
          if { $range eq "" } {set range {0 end}}
          set src [parse getstring $script $range]
          set orgStart [lindex $range 0]      ;# here our src started in reality
          # 'parse list' returns the range of each element
          set res [parse list $src {0 end}]
          for {set i 0} {$i < [llength $res]} {incr i} {
              set start [lindex $res $i 0]
              lset res $i 0 [expr {$start + $orgStart}]
          }
      ...
      
              ---
      
      Add a description of what the 'countnewline' subcommand does and what parameters it expects.
      
      Best regards
      Helmut Giese
      
      
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "hgiese"
    10. subsystem initialized to: "45. Parsing and Eval"
    11. title initialized to: "Documentation for TclParser is not good"
    12. type initialized to: "Bug"
  2. Ticket change [19dd0a9da6] (rid 122868) by msofer on 2009-06-30 04:41:17:

    1. assignee changed to: "dgp"
  3. Ticket change [9c43d2976d] (rid 96119) by dgp on 2009-06-30 04:47:27:

    1. icomment:
      
      There is no parse.n file in the source
      code distribution of Tcl and no [parse]
      command among Tcl's built-in commands.
      
      Please file your report in the appropriate project.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  4. Ticket change [618b0e0ab2] (rid 92258) by dgp on 2009-06-30 04:47:28:

    1. closedate changed to: "2009-06-29T21:47:28"
    2. closer changed to: "dgp"
    3. icomment:
      
      
      allow_comments - 1
      
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"
    8. username: "dgp"