Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2013-08-09
08:01 • Closed ticket [0c86d397be]: auto_mkindex fails on "if-else" statements... artifact: 4b26ac6500 user: tombert
2013-08-06
12:17 • Ticket [0c86d397be]: 5 changes artifact: bbb8bba357 user: dgp
09:50 • Ticket [0c86d397be]: 4 changes artifact: a1d59922f9 user: anonymous
09:49 • Ticket [0c86d397be]: 3 changes artifact: 0424da1b7a user: anonymous
09:30 • New ticket [0c86d397be]. artifact: e58c5d6e25 user: anonymous

auto_mkindex fails on "if-else" statements outside any procedure

Closed / Works For Me0c86d397becdae7de0cf6e99fd24bc7527688f5aCreated 13 years agoUpdated 13 years ago
Descriptionplain2013-08-06 09:30:50
Win7, mingw, Tcl 8.6 head;

The call to:

auto_mkindex d:/ mkindex-test.tcl

fails if there is a if-else statement outside any procedure or method.
Reproduce: Create a file which content is only:

if {$something == 1} {puts yes} else {puts no}

results in an error:

wrong # args: should be "if name body"
    invoked from within
"if { something == 1} {puts yes} else {puts no}"
    invoked from within
"$parser eval $contents"
    (procedure "auto_mkindex_parser::mkindex" line 27)
    invoked from within
"auto_mkindex_parser::mkindex $file"
    (procedure "auto_mkindex" line 23)
    invoked from within
"auto_mkindex d:/ mkindex-test.tcl"


Note: When removing the "else" part then it works.

thx
anonymous Ticket [0c86d397be]: 3 changes [History diff]2013-08-06 09:49:08
anonymous Ticket [0c86d397be]: 4 changes [History diff]2013-08-06 09:50:06
dgpplain2013-08-06 12:17:56
I cannot reproduce this.

See if you can track down where
the [::if] command has been redefined
and to what. It sure looks like something
has replaced [::if] with an incomplete
replacement.

I notice that the "$" before something
has disappeared in the -errorinfo.  Any
idea what happened there?
tombertplain2013-08-09 08:01:01
Thx for this tip - the bug was on my side.
Regards
Log in (anonymous is fine) to add a comment.