diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/code.l | 2 | ||||
-rw-r--r-- | src/config.l | 58 | ||||
-rw-r--r-- | src/doxygen.cpp | 6 | ||||
-rw-r--r-- | src/htmlgen.cpp | 4 | ||||
-rw-r--r-- | src/latexgen.cpp | 8 | ||||
-rw-r--r-- | src/mangen.cpp | 4 | ||||
-rw-r--r-- | src/mangen.h | 2 | ||||
-rw-r--r-- | src/memberdef.cpp | 37 | ||||
-rw-r--r-- | src/memberlist.cpp | 2 | ||||
-rw-r--r-- | src/scanner.l | 34 | ||||
-rw-r--r-- | src/util.cpp | 6 |
11 files changed, 121 insertions, 42 deletions
@@ -887,7 +887,7 @@ SCOPENAME (({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) <RemoveSpecialCComment>"//"|"/*" <RemoveSpecialCComment>\n { g_yyLineNr++; } <RemoveSpecialCComment>. -<*>\n({B}*"//"[!/][^\n]*\n)* { // remove special one-line comment +<*>\n({B}*"//"[!/][^\n]*\n)+ { // remove special one-line comment if (Config::stripCommentsFlag) { g_yyLineNr+=((QCString)yytext).contains('\n'); diff --git a/src/config.l b/src/config.l index 01cb527..faaebda 100644 --- a/src/config.l +++ b/src/config.l @@ -1650,11 +1650,59 @@ static void substEnvVarsInStrList(QStrList &sl) { QCString result(s); substEnvVarsInString(result); - - // replace the string in the list and go to the next item. - sl.insert(sl.at(),result); // insert new item before current item. - sl.next(); // current item is now the old item - int i=sl.at(); + + int l=result.length(); + int i,p=0; + // skip spaces + // search for a "word" + for (i=0;i<l;i++) + { + char c; + // skip until start of new word + for (;i<l && ((c=result.at(i))==' ' || c=='\t');i++) + p=i; // p marks the start index of the word + // skip until end of a word + for (;i<l && ((c=result.at(i))!=' ' && c!='\t' && c!='"');i++); + if (i<l) // not at the end of the string + { + if (c=='"') // word within quotes + { + p=i+1; + for (i++;i<l;i++) + { + c=result.at(i); + if (c=='"') // end quote + { + // replace the string in the list and go to the next item. + sl.insert(sl.at(),result.mid(p,i-p)); // insert new item before current item. + sl.next(); // current item is now the old item + p=i+1; + break; + } + else if (c=='\\') // skip escaped stuff + { + i++; + } + } + } + else if (c==' ' || c=='\t') // separator + { + // replace the string in the list and go to the next item. + sl.insert(sl.at(),result.mid(p,i-p)); // insert new item before current item. + sl.next(); // current item is now the old item + p=i+1; + } + } + } + if (p!=l) // add the leftover as a string + { + // replace the string in the list and go to the next item. + sl.insert(sl.at(),result.right(l-p)); // insert new item before current item. + sl.next(); // current item is now the old item + } + + // remove the old unexpanded string from the list + i=sl.at(); sl.remove(); // current item index changes if the last element is removed. if (sl.at()==i) // not last item s = sl.current(); diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 98cccb4..9c51f74 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -863,7 +863,7 @@ static MemberDef *addVariableToClass(Entry *root,ClassDef *cd, md->setFromAnnonymousMember(fromAnnMemb); md->setIndentDepth(indentDepth); md->setBodySegment(root->bodyLine,root->endBodyLine); - md->setInitializer(root->initializer.simplifyWhiteSpace()); + md->setInitializer(root->initializer); //if (root->mGrpId!=-1) //{ // printf("memberdef %s in memberGroup %d\n",name.data(),root->mGrpId); @@ -922,7 +922,7 @@ static MemberDef *addVariableToFile(Entry *root,MemberDef::MemberType mtype, md->setFromAnnonymousMember(fromAnnMemb); md->setIndentDepth(indentDepth); md->setBodySegment(root->bodyLine,root->endBodyLine); - md->setInitializer(root->initializer.simplifyWhiteSpace()); + md->setInitializer(root->initializer); bool ambig; FileDef *fd=findFileDef(&inputNameDict,root->fileName,ambig); md->setBodyDef(fd); @@ -2010,7 +2010,7 @@ void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, if (md->initializer().isEmpty() && !root->initializer.isEmpty()) { - md->setInitializer(root->initializer.simplifyWhiteSpace()); + md->setInitializer(root->initializer); } //if (md->bodyCode().isEmpty() && !root->body.isEmpty()) /* no body yet */ diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index af3ecce..17a9763 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -605,7 +605,7 @@ void HtmlGenerator::startParameter(bool first) if (first) { t << endl << "</b></td>" << endl; - t << "<td><b>" << endl; + t << "<td valign=bottom><b>" << endl; } else { @@ -767,7 +767,7 @@ void HtmlGenerator::startMemberDoc(const char *,const char *,const char *,const t << " <td class=\"md\"><b>" << endl; t << " <table cellspadding=0 cellspacing=0 border=0>" << endl; t << " <tr>" << endl; - t << " <td><b>" << endl; + t << " <td valign=top><b>" << endl; } void HtmlGenerator::endMemberDoc() diff --git a/src/latexgen.cpp b/src/latexgen.cpp index a22a804..f927059 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -1134,18 +1134,22 @@ void LatexGenerator::docify(const char *str) void LatexGenerator::codify(const char *str) { - static char spaces[]=" "; if (str) { const char *p=str; char c; + int spacesToNextTabStop; while (*p) { c=*p++; switch(c) { case 0x0c: break; // remove ^L - case '\t': t << &spaces[col&7]; col+=8-(col&7); break; + case '\t': spacesToNextTabStop = + Config::tabSize - (col%Config::tabSize); + t << spaces.left(spacesToNextTabStop); + col+=spacesToNextTabStop; + break; case '\n': t << '\n'; col=0; break; default: t << c; col++; break; } diff --git a/src/mangen.cpp b/src/mangen.cpp index 5b1a7d1..8fc023c 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -224,8 +224,8 @@ void ManGenerator::codify(const char *str) t << spaces.left(spacesToNextTabStop); col+=spacesToNextTabStop; break; - case '\n': t << "\n.br\n"; firstCol=TRUE; col=0; break; - case '\\': t << "\\\\"; col++; break; + case '\n': t << "\n"; firstCol=TRUE; col=0; break; + case '\\': t << "\\"; col++; break; default: t << c; firstCol=FALSE; col++; break; } } diff --git a/src/mangen.h b/src/mangen.h index 1f4ebec..a21be05 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -107,7 +107,7 @@ class ManGenerator : public OutputGenerator void startCodeFragment(); void endCodeFragment(); void startCodeLine() {} - void endCodeLine() { t << endl; } + void endCodeLine() { t << endl; col=0; } void writeBoldString(const char *text) { t << "\\fB"; docify(text); t << "\\fR"; firstCol=FALSE; } void startEmphasis() { t << "\\fI"; firstCol=FALSE; } diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 86b91bf..36d4945 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -157,6 +157,10 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd, ol.endParameter(FALSE); } } + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + ol.writeString(" "); + ol.popGeneratorState(); ol.docify(")"); // end argument list if (argList->constSpecifier) { @@ -728,8 +732,16 @@ void MemberDef::writeDeclaration(OutputList &ol, if (!init.isEmpty() && initLines==0) // add initializer { - if (!isDefine()) ol.writeString(" = "); else ol.writeNonBreakableSpace(); - linkifyText(ol,cname,name(),init); + if (!isDefine()) + { + ol.writeString(" = "); + linkifyText(ol,cname,name(),init.simplifyWhiteSpace()); + } + else + { + ol.writeNonBreakableSpace(); + linkifyText(ol,cname,name(),init); + } } if (!detailsVisible && !Config::extractAllFlag && !annMemb) @@ -905,8 +917,16 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, writeDefArgumentList(ol,cd,scopeName,this); if (!init.isEmpty() && initLines==0) // add initializer { - if (!isDefine()) ol.docify(" = "); else ol.writeNonBreakableSpace(); - linkifyText(ol,scopeName,name(),init); + if (!isDefine()) + { + ol.docify(" = "); + linkifyText(ol,scopeName,name(),init.simplifyWhiteSpace()); + } + else + { + ol.writeNonBreakableSpace(); + linkifyText(ol,scopeName,name(),init); + } } if (excpString()) // add exception list { @@ -975,7 +995,14 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, parseText(ol,theTranslator->trInitialValue()); ol.endBold(); ol.startCodeFragment(); - parseCode(ol,scopeName,init,FALSE,0); + if (isDefine()) + { + parseCode(ol,scopeName,init,FALSE,0); + } + else + { + parseCode(ol,scopeName,init.simplifyWhiteSpace(),FALSE,0); + } ol.endCodeFragment(); } diff --git a/src/memberlist.cpp b/src/memberlist.cpp index ec884b8..f1bdfd3 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -559,6 +559,8 @@ void MemberList::writeDeclarations(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, const char *title,const char *subtitle,bool inGroup) { + //printf("MemberList::writeDeclaration(title=`%s',subtitle=`%s')\n", + // title,subtitle); countDecMembers(inGroup); if (totalCount()==0) return; if (title) diff --git a/src/scanner.l b/src/scanner.l index 589bbff..ae2cc8f 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -49,8 +49,6 @@ #define YY_NEVER_INTERACTIVE 1 - - /* ----------------------------------------------------------------- * * statics @@ -874,7 +872,7 @@ SCOPENAME (({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) SCOPEMASK {ID}?(("::"|"#")?(~)?{ID})+ URLMASK [a-z_A-Z0-9\~\:\@\#\.\-\+\/]+ NONTERM [\{\}\[\]\`\~\@\|\-\+\#\$\/\\\!\%\^\&\*()a-z_A-Z<>0-9] -WORD ({NONTERM}+([^\n ]*{NONTERM}?))|("\""[^\n\"]"\"") +WORD ({NONTERM}+([^\n\t ]*{NONTERM}+)?)|("\""[^\n\"]"\"") ATTR ({B}+[^>\n]*)? A [aA] BOLD [bB] @@ -1651,8 +1649,9 @@ DOCPARAM ([a-z_A-Z0-9:\.\-]+)|("\"".*"\"") } BEGIN(DocScan); } -<DocRefName>{SCOPENAME}/{B}+"\"" { +<DocRefName>{SCOPENAME}{B}+/"\"" { sectionRef=yytext; + sectionRef=sectionRef.stripWhiteSpace(); BEGIN(DocRefArgStart); } <DocRefArgStart>"\"" { @@ -2011,22 +2010,16 @@ DOCPARAM ([a-z_A-Z0-9:\.\-]+)|("\"".*"\"") outDoc->endEmphasis(); BEGIN( DocScan ); } -<DocBold>{WORD} { - outDoc->startBold(); - linkifyText(*outDoc,className,0,yytext); - outDoc->endBold(); - BEGIN( DocScan ); - } <DocBold>[a-z_A-Z][a-z_A-Z:0-9<>&\-=^%~!\[\]()|\*/]*"()" { outDoc->startBold(); generateRef(*outDoc,className,yytext,inSeeBlock); outDoc->endBold(); BEGIN( DocScan ); } -<DocCode>{WORD} { - outDoc->startTypewriter(); +<DocBold>{WORD} { + outDoc->startBold(); linkifyText(*outDoc,className,0,yytext); - outDoc->endTypewriter(); + outDoc->endBold(); BEGIN( DocScan ); } <DocCode>[a-z_A-Z][a-z_A-Z:0-9<>&\-=^%~!\[\]()|\*/]*"()" { @@ -2035,6 +2028,12 @@ DOCPARAM ([a-z_A-Z0-9:\.\-]+)|("\"".*"\"") outDoc->endTypewriter(); BEGIN( DocScan ); } +<DocCode>{WORD} { + outDoc->startTypewriter(); + linkifyText(*outDoc,className,0,yytext); + outDoc->endTypewriter(); + BEGIN( DocScan ); + } <DocInclude>{FILE} { includeFile(*outDoc,stripQuotes(yytext),FALSE); BEGIN( DocScan ); @@ -2091,12 +2090,9 @@ DOCPARAM ([a-z_A-Z0-9:\.\-]+)|("\"".*"\"") <DocScan>{BN}+/\n { outDoc->writeChar(' '); } -<DocScan>{B}+ { +<DocScan>\n?{B}* { outDoc->writeChar(' '); } -<DocScan>\n { - outDoc->writeChar('\n'); - } <DocCode,DocEmphasis,DocBold,DocScan,Text>[a-z_A-Z0-9]+ { outDoc->docify(yytext); } @@ -3139,7 +3135,7 @@ DOCPARAM ([a-z_A-Z0-9:\.\-]+)|("\"".*"\"") } <Curly>. { current->program += yytext ; } -<FindMembers>"("({ID}{BN}*"::"{BN}*)*("*"{BN}*)+ { +<FindMembers>"("({BN}*{ID}{BN}*"::"{BN}*)*("*"{BN}*)+ { current->bodyLine = yyLineNr; lineCount(); addType(current); @@ -4261,6 +4257,8 @@ DOCPARAM ([a-z_A-Z0-9:\.\-]+)|("\"".*"\"") memberGroupDocs+="\n\n"; } memberGroupDocs+=current->doc; + current->doc.resize(0); + current->brief.resize(0); BEGIN(lastDocContext); } <ExampleDoc,Doc,PageDoc,JavaDoc,ClassDoc>{CMD}"anchor"{B}+ { diff --git a/src/util.cpp b/src/util.cpp index 4b0d369..ccffae9 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -252,7 +252,7 @@ bool leftScopeMatch(const QCString &scope, const QCString &name) void linkifyText(OutputList &ol,const char *scName,const char *name,const char *text) { //printf("scope=`%s' name=`%s' Text: `%s'\n",scName,name,text); - static QRegExp regExp("[a-z_A-Z0-9:]+"); + static QRegExp regExp("[a-z_A-Z][a-z_A-Z0-9:]*"); QCString txtStr=text; OutputList result(&ol); int matchLen; @@ -860,8 +860,8 @@ static void trimNamespaceScope(QCString &t1,QCString &t2) int p2=t2.length(); for (;;) { - int i1=t1.findRev("::",p1); - int i2=t2.findRev("::",p2); + int i1=p1==0 ? -1 : t1.findRev("::",p1); + int i2=p2==0 ? -1 : t2.findRev("::",p2); if (i1==-1 && i2==-1) { return; |