Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Syntax error due to commented out line of TCL.

Closed / Fixed218240ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:54:57
OriginalBugID: 2791 Bug
Version: 8.2
SubmitDate: '1999-09-16'
LastModified: '1999-09-16'
Severity: MED
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
OS: Solaris
Machine: Other
FixedDate: '2000-10-25'
ClosedDate: '1999-09-16'


Name:

Louis Petro



Comments:

Yes - one other question.  Is there anyway in TCL to know the current

    line number and possible the file name.  I'd like to use this

    information for debugging similiar to the __LINE__ and __FILE_ used by

    the C programming language.



ReproducibleScript:

set x 0

    

    while { $x < 10 } {

    # while { $x < 21 } {

    incr x

    }



ObservedBehavior:

User in our organization tend to copy code and comment out code alot.

    We've found that commented code is still being syntactically

    check by TCL.  In the above example user's we receive a syntax error

    unless the commented out code is syntactically complete, e.g.,

    

    # while { $x < 21 } { }

    

    Has this problem been identified?



DesiredBehavior:

I;d expect that a commented line would be treated as a comment in TCL.



PatchFiles:

I found that if the commented line is outside the loop above it then

    does not after the "while" loop.

    

    set x 0

    

    #while { $x < 21 }

    while { $x < 10 } {

    incr x

    }





This is the comment problem cropping up again, and this was answered
in the newsgroup (cover large blocks with if 0 { }). 
-- 09/16/1999 hobbs
welch Closed ticket [218240ffff]. [History diff]2000-10-26 08:17:55
dgp Ticket [218240ffff]: 3 changes [History diff]2001-04-19 00:48:30
Log in (anonymous is fine) to add a comment.