Skip to content
Tcl Source Code View Ticket
Login

View Ticket

tcl parses commented code.

Closed / Fixed218043ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:52:30
OriginalBugID: 1367 Bug
Version: 8.0.4
SubmitDate: '1999-03-02'
LastModified: '1999-08-07'
Severity: SER
Status: Closed
Submitter: pat
ChangedBy: hobbs
OS: Windows 95
Machine: X86
FixedDate: '2000-10-25'
ClosedDate: '1999-08-07'


Name:

john f. davis


ReproducibleScript:

I had some code which was commented out, but the interpeter gave me an error 

on code which was commented out.


#      for {foo} {foo) {foo} {


ObservedBehavior:

The interpeter said there was a missing brace.  Didn't tell me where in the code it was, so i started commenting out lines a line at a time.  I still got errors

even though the code with the error was commented out.   The error was that the 

second {} group in the for loop had a ")" instead of a "}".


DesiredBehavior:

I expected the missing-brace error to tell me a line number first of all.  Second, I expected that the code would be ignored when commented out.




This is the expected behavior.  Brace balancing has precedent over
comment detection, which can lead to programming errors like the
above.  Compare with this perfectly legal statement:
    if {1} { puts hello; # I just puts'ed it }

The parser will check that the if has two args first, then when
true it will eval the body arg and see the two commands, the
second being a comment. 
-- 08/07/1999 hobbs
welch Closed ticket [218043ffff]. [History diff]2000-10-26 08:13:43
dgp Ticket [218043ffff]: 3 changes [History diff]2001-04-16 23:44:43
Log in (anonymous is fine) to add a comment.