From 61a987f886200cc62a786c3bd558f428062cf529 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Wed, 31 Jul 2019 13:06:38 +0200 Subject: issue 7068: "QGDict::hashAsciiKey: Invalid null key" error messages (part 2) --- src/doxygen.cpp | 4 ++-- src/scanner.l | 24 ++++++++++++++++-------- src/util.cpp | 4 ++++ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 6f59411..18936fa 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -3650,9 +3650,9 @@ static void buildFunctionList(Entry *root) ) { GroupDef *gd=0; - if (root->groups->getFirst()!=0) + if (root->groups->getFirst() && !root->groups->getFirst()->groupname.isEmpty()) { - gd = Doxygen::groupSDict->find(root->groups->getFirst()->groupname.data()); + gd = Doxygen::groupSDict->find(root->groups->getFirst()->groupname); } //printf("match!\n"); //printf("mnd=%p rnd=%p nsName=%s rnsName=%s\n",mnd,rnd,nsName.data(),rnsName.data()); diff --git a/src/scanner.l b/src/scanner.l index 13abcbb..1b948dd 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -614,6 +614,7 @@ PRE [pP][rR][eE] CODE [cC][oO][dD][eE] CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] +PHPUSEKW ("public"|"private"|"protected") IDLATTR ("["[^\]]*"]"){BN}* TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) RAWBEGIN (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"(" @@ -867,12 +868,6 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } . { // Non-PHP code text, ignore } -"?>"|"" { // PHP code end - if (insidePHP) - BEGIN( FindMembersPHP ); - else - REJECT; - } {PHPKW} { if (insidePHP) BEGIN( NextSemi ); else @@ -2012,6 +2007,8 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) {BN}+"as"{BN}+ { lineCount(); } +{PHPUSEKW} { + } {ID} { //printf("PHP: adding use as relation: %s->%s\n",yytext,aliasName.data()); if (!aliasName.isEmpty()) @@ -2319,6 +2316,9 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) \n { *pCopyHereDocGString += yytext; } +{ID} { + *pCopyHereDocGString += yytext; + } . { *pCopyHereDocGString += yytext; } @@ -5380,7 +5380,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) lineCount(); //addToBody(yytext); } -"<<<" { +"<<<" { if (!insidePHP) { REJECT; @@ -6885,7 +6885,6 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } - /* ------------ Generic rules -------------- */ .*"\\\n" { // line continuation @@ -6903,6 +6902,15 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } [^\*\n]+ + /* ------------ Generic rules -------------- */ + +<*>"?>"|"" { // PHP code end + if (insidePHP) + BEGIN( FindMembersPHP ); + else + REJECT; + } + <*>"[[" { // C++11 attribute if (!insideCpp) REJECT; if (YY_START == CopyGString || YY_START == CopyGString) REJECT; diff --git a/src/util.cpp b/src/util.cpp index 695a52c..163bb23 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -4564,6 +4564,10 @@ static bool getScopeDefs(const char *docScope,const char *scope, scopeName=scopeName.right(scopeName.length()-2); explicitGlobalScope=TRUE; } + if (scopeName.isEmpty()) + { + return FALSE; + } QCString docScopeName=docScope; int scopeOffset=explicitGlobalScope ? 0 : docScopeName.length(); -- cgit v0.12