Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-14
02:00 • Ticket [217891ffff] tcl parser has problems with braces in strings status st... artifact: 61dbb9e0f7 user: dgp
2000-10-26
08:09 • Closed ticket [217891ffff]. artifact: 2a549ec836 user: welch
00:45 • New ticket [217891ffff]. artifact: 6a200487e2 user: nobody

tcl parser has problems with braces in strings

Closed / Fixed217891ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:45:30
OriginalBugID: 2441 Bug
Version: 8.0.5
SubmitDate: '1999-07-23'
LastModified: '1999-08-04'
Severity: CRIT
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
RelatedBugIDs: 2474
OS: IRIX
OSVersion: also, NT 4.0sp4
Machine: Other
FixedDate: '2000-10-25'
ClosedDate: '1999-08-04'


Name:

David Laur



CustomShell:

using ONLY Scriptics supplied,



Comments:

Obviously for the simple example above I can easily escape the braces,

    this is phenomenally untrue of the real app.

    

    Thanks!

    David



ReproducibleScript:

As far as I know, this is a long-standing problem with the Tcl parser,

    so long in fact that I wonder if this is maybe a user-error on my part?

    

    There appear to be several "parsing scenarios" in effect when using

    Tcl,

    and their behavior regarding this problem is subtly different, although

    related.  Also, behavior on Windows is slightly different than Unix.

    

    Basically, string containing curly braces are not always parsed

    correctly.

    

    I'm being hit very hard by this problem right now since I'm trying to

    use

    Tcl to generate code (Tcl and C source code) which contains braces.

    

    Consider the following five lines:

    

    --------- begin snippet -------

    puts "}"

    proc x {} {

       puts "}"

    }

    x

    ----------- end snippet -------

    

    I expect that this code will print:

    }

    }

    in all circumstances.



ObservedBehavior:

Scenario One - entering the commands via the tcl stdin prompt:

    

    <dml> protclsh80

    % puts "}"

    }

    % proc x {} {

       puts "}"

    extra characters after close-brace

    %

    

    

    Scenario Two -  sourcing a file containing those five lines:

    

    <dml> protclsh80

    % source test.tcl

    extra characters after close-brace

    % set errorInfo

    extra characters after close-brace

        while compiling

    "proc x {} { ..."

        (file "test.tcl" line 2)

        invoked from within

    "source test.tcl"

    %

    

    

    Scenario Three - the test file specified as tclsh startup script

    

    <dml> protclsh80 test.tcl

    extra characters after close-brace

        while compiling

    "proc x {} { ..."

        (file "test.tcl" line 2)

    

    

    On Windows (NT) I get similar, but not identical errors.



DesiredBehavior:

I would expect the parser to recognize when it has entered a quoted

    string and when it hasn't.
welch Closed ticket [217891ffff]. [History diff]2000-10-26 08:09:11
dgp Ticket [217891ffff]: 3 changes [History diff]2001-04-14 02:00:53
Log in (anonymous is fine) to add a comment.