View Ticket
Not logged in
Tcl 2014 Conference, Portland/OR, US, Nov 10-14
Browse the schedule online.
Ticket UUID: 70176515d1019f8f11e18ff0cc9c7454b94c4dce
Title: Errors in list commands when list has a space before a closing quote
Type: Bug Version: 8.5.11
Submitter: migfilg Created on: 2014-01-28 16:59:04
Subsystem: 14. List Object Assigned To: dgp
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2014-01-28 19:30:41
Resolution: Invalid Closed By: dgp
    Closed on: 2014-01-28 19:30:41
Description:
Unexpected errors with (at least) lindex and lassign commands acting
on a list that has a space before a closing quote:

> lindex {x="a" y="a " z="a"}
list element in quotes followed by "a"" instead of space
> lassign {x="a" y="a " z="a"} v
list element in quotes followed by "a"" instead of space

In my view, either the quote before z is a separate list element after
'y="a' and before 'z="a"', or it matches the previous one after 'y=' 
and in both cases it will not match the next one and leave 'a"' as
a spurious continuation of a list element...

This must really be bug: compare with
> lindex {x="a" y=" a" z="a"} 0
x="a"
> lindex {x="a" y=" a" z="a"} 1
y="
> lindex {x="a" y=" a" z="a"} 2
a"
> lindex {x="a" y=" a" z="a"} 3
z="a"

Thanks in advance for any help in coping with this,
Miguel Filgueiras
User Comments: dgp added on 2014-01-28 19:30:41:
There is no bug here.

See http://www.tcl.tk/cgi-bin/tct/tip/407.html

for detail on the rules for parsing the elements
of a list from a string.