Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3cfb0aa00e05d186616a15a7caf34705168e0ff10ff7fd42be7556f4f0876ef0
Ticket: 7cc223908762351c613244a0914a2d13acf7cfd2
continuation lines \<newline> produce wrong line numbers in tracebacks
User & Date: anonymous on 2020-01-01 18:29:44
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    When using continuation lines with the \<newline> substitution
    rule, it causes error trace-backs to have the wrong line numbers
    and [info body] doesn't return the original script as is, but
    only after the substitution, thus also affecting line numbers.
    
    For example, this script
    
    proc foo {args} {
    	set bar [string repeat \
    	"blah" \
    	50]
    	expr 1/0
    }
    foo
    
    will report a divide by zero error on line 3 of foo, not line 5.
     
    Also, [info body] will return the command changed as so:
    
    	set bar [string repeat "blah" 50]
    
    which can also affect the reporting of line numbers. 
    
    The problem is likely that the saving of the script for a
    proc is done after the \<newline> pre-process pass rather
    than before. This probably causes traceback to miscount 
    <newlines> while scanning the script text to find the line
    in error.
    
  5. foundin changed to: "8.6.9"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. resolution changed to: "None"
  10. severity changed to: "Minor"
  11. status changed to: "Open"
  12. submitter changed to: "anonymous"
  13. subsystem changed to: "45. Parsing and Eval"
  14. title changed to:
    continuation lines \<newline> produce wrong line numbers in tracebacks
    
  15. type changed to: "Bug"