Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5f68913ec91abeca7609e1607831940f05110dac
Ticket: 218980ffffffffffffffffffffffffffffffffff
Improve error message for missing close brace
User & Date: nobody on 2000-10-26 01:08:54
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 3434 RFE
    Version: 8.2.1
    SubmitDate: '1999-11-05'
    LastModified: '1999-12-03'
    Severity: MED
    Status: Released
    Submitter: techsupp
    ChangedBy: hobbs
    OS: HP-UX
    OSVersion: 10.20
    FixedDate: '1999-12-03'
    FixedInVersion: 8.3b1
    ClosedDate: '2000-10-25'
    
    
    Name:
    
    Bob Techentin
    
    
    Comments:
    
    Perhaps a little different wording in the message?
    
    
    DesiredBehavior:
    
    Per http://www.deja.com/getdoc.xp?AN=544049227
    
    Here is a patch to tclParse.c which will issue a little
    
    more detailed message if it detects a missing close 
    
    brace in a block which might contains a comment
    
    character preceeding an open-brace.
    
    
    Patch:
    
    *** ../generic/tclParse.c       Wed Nov  3 15:06:36 1999
    
    --- ../generic/tclParse.c.orig  Wed Nov  3 14:07:47 1999
    
    ***************
    
    *** 1895,1901 ****
    
          Tcl_Token *tokenPtr;
    
          register char *src, *end;
    
          int startIndex, level, length;
    
    -     int openBrace;
    
    
          if ((numBytes >= 0) || (string == NULL)) {
    
            end = string + numBytes;
    
    --- 1895,1900 ----
    
    ***************
    
    *** 1976,2010 ****
    
            } else if (src == end) {
    
                if (interp != NULL) {
    
                    Tcl_SetResult(interp, "missing close-brace", TCL_STATIC);
    
    - 
    
    -               /*
    
    -                *  Search the source string for a possible open
    
    -                *  brace within the context of a comment.  Since we
    
    -                *  aren't performing a full Tcl parse, just look for
    
    -                *  an open brace preceeded by a '<whitspace>#' on 
    
    -                *  the same line.
    
    -                */
    
    -               openBrace = 0;
    
    -               while ( src > string ) {
    
    -                 switch (*src) {
    
    -                 case '{': 
    
    -                   openBrace = 1; 
    
    -                   break;
    
    -                 case '\n':
    
    -                   openBrace = 0; 
    
    -                   break;
    
    -                 case '#':
    
    -                   if ((openBrace == 1) && (isspace(*(--src)))) {
    
    -                     Tcl_SetResult(interp, "missing close-brace:\nYou probably screwed up by putting an open brace in a comment.\nBraces must be balanced, EVEN IN COMMENTS!\nDo NOT, under any circumstances, post a question about it on comp.lang.tcl", TCL_STATIC);
    
    -                     openBrace = -1;
    
    -                     break;
    
    -                   }
    
    -                 }
    
    -                 if (openBrace == -1) {
    
    -                   break;
    
    -                 } 
    
    -                 src--;
    
    -               }
    
                }
    
                parsePtr->errorType = TCL_PARSE_MISSING_BRACE;
    
                parsePtr->term = string;
    
    --- 1975,1980 ----
    
    
    PatchFiles:
    
    generic/tclParse.c
    
    
    
    
    improved error messages in 8.3b1. 
    -- 12/03/1999 hobbs
    
  4. foundin changed to: "obsolete: 8.2.1"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to: "Improve error message for missing close brace"
  11. type changed to: "RFE"