Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2014-01-28
19:30 • Closed ticket [70176515d1]: Errors in list commands when list has a space before... artifact: f331bdf56e user: dgp
16:59 • New ticket [70176515d1]. artifact: 067e9167fd user: migfilg

Errors in list commands when list has a space before a closing quote

Closed / Invalid70176515d1019f8f11e18ff0cc9c7454b94c4dceCreated 13 years agoUpdated 13 years ago
Descriptionplain2014-01-28 16:59:04
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
dgpplain2014-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.
Log in (anonymous is fine) to add a comment.