Skip to content

Commit 7e99e9b

Browse files
committed
QGDict::hashAsciiKey: Invalid null key due to empty procedure name
When having a problem like: ``` namespace eval ::tk::dialog {} namespace eval ::tk::dialog::file {} namespace eval ::tk::dialog::file::chooseDir { namespace import -force ::tk::msgcat::* } proc ::tk::dialog::file::chooseDir:: {args} { } ``` This will lead to the following warnings: ``` QGDict::hashAsciiKey: Invalid null key .../aa.tcl:9: warning: Illegal member name found. ``` this is due to the fact that the procedure name definition ends with `::` and thus actually has an empty procedure name (this is legal in TCL). (see also: https://stackoverflow.com/questions/58683103/meaning-of-a-proc-name-ending-with). In case of an empty name the last component is taken for the name too.
1 parent cc4675a commit 7e99e9b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/tclscanner.l

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,13 @@ static void tcl_name(const QCString &ns0, const QCString &name0, QCString &ns, Q
535535
ns = "";
536536
name = myNm;
537537
}
538+
else if (myNm.length()-myStart == 2)
539+
{
540+
// ending with :: so get name equal to last component
541+
ns = myNm.mid(0,myStart);
542+
myStart = ns.findRev("::");
543+
name = myNm.mid(myStart+2);
544+
}
538545
else
539546
{
540547
ns = myNm.mid(0,myStart);

0 commit comments

Comments
 (0)