From 7e99e9b66c48da2dfeea29f14b207a30aae62a1e Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 4 Nov 2019 12:52:39 +0100 Subject: 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. --- src/tclscanner.l | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tclscanner.l b/src/tclscanner.l index 4a262bc..45ad9c0 100644 --- a/src/tclscanner.l +++ b/src/tclscanner.l @@ -535,6 +535,13 @@ static void tcl_name(const QCString &ns0, const QCString &name0, QCString &ns, Q ns = ""; name = myNm; } + else if (myNm.length()-myStart == 2) + { + // ending with :: so get name equal to last component + ns = myNm.mid(0,myStart); + myStart = ns.findRev("::"); + name = myNm.mid(myStart+2); + } else { ns = myNm.mid(0,myStart); -- cgit v0.12