summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-02-03 20:26:05 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-02-03 20:26:05 (GMT)
commit0dc96d28963f2260786650be0a5fa360d02045ae (patch)
tree7925f59cfb99e02d977131101c488f824605629c /src
parentb4d5ef176eced8315523baea464cfda733ecb9aa (diff)
parentcd68727a749fb2d3fd7ade308a080646989564a2 (diff)
downloadDoxygen-0dc96d28963f2260786650be0a5fa360d02045ae.zip
Doxygen-0dc96d28963f2260786650be0a5fa360d02045ae.tar.gz
Doxygen-0dc96d28963f2260786650be0a5fa360d02045ae.tar.bz2
Merge branch 'master' of github.com:doxygen/doxygen
Diffstat (limited to 'src')
-rw-r--r--src/commentcnv.l41
-rw-r--r--src/config.xml9
-rw-r--r--src/doxygen.sty4
-rw-r--r--src/latexdocvisitor.cpp5
-rw-r--r--src/latexgen.cpp19
-rw-r--r--src/mangen.cpp20
-rw-r--r--src/sqlite3gen.cpp42
7 files changed, 113 insertions, 27 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l
index 6433974..b12623c 100644
--- a/src/commentcnv.l
+++ b/src/commentcnv.l
@@ -52,6 +52,13 @@ struct CondCtx
bool skip;
};
+struct CommentCtx
+{
+ CommentCtx(int line)
+ : lineNr(line) {}
+ int lineNr;
+};
+
static BufStr * g_inBuf;
static BufStr * g_outBuf;
static int g_inBufPos;
@@ -64,6 +71,7 @@ static QCString g_fileName;
static int g_lineNr;
static int g_condCtx;
static QStack<CondCtx> g_condStack;
+static QStack<CommentCtx> g_commentStack;
static QCString g_blockName;
static int g_lastCommentContext;
static bool g_inSpecialComment;
@@ -256,8 +264,10 @@ void replaceComment(int offset);
{
g_pythonDocString = TRUE;
g_nestingCount=0;
+ g_commentStack.clear(); /* to be on the save side */
copyToOutput(yytext,(int)yyleng);
BEGIN(CComment);
+ g_commentStack.push(new CommentCtx(g_lineNr));
}
}
<Scan>![><!]/.*\n {
@@ -269,7 +279,9 @@ void replaceComment(int offset);
{
copyToOutput(yytext,(int)yyleng);
g_nestingCount=0;
+ g_commentStack.clear(); /* to be on the save side */
BEGIN(CComment);
+ g_commentStack.push(new CommentCtx(g_lineNr));
}
}
<Scan>[Cc\*][><!]/.*\n {
@@ -284,7 +296,9 @@ void replaceComment(int offset);
{
copyToOutput(yytext,(int)yyleng);
g_nestingCount=0;
+ g_commentStack.clear(); /* to be on the save side */
BEGIN(CComment);
+ g_commentStack.push(new CommentCtx(g_lineNr));
}
else
{
@@ -378,8 +392,10 @@ void replaceComment(int offset);
<Scan>"/*"[*!]? { /* start of a C comment */
g_specialComment=(int)yyleng==3;
g_nestingCount=0;
+ g_commentStack.clear(); /* to be on the save side */
copyToOutput(yytext,(int)yyleng);
BEGIN(CComment);
+ g_commentStack.push(new CommentCtx(g_lineNr));
}
<Scan>"#"("#")? {
if (g_lang!=SrcLangExt_Python)
@@ -390,7 +406,9 @@ void replaceComment(int offset);
{
copyToOutput(yytext,(int)yyleng);
g_nestingCount=0;
+ g_commentStack.clear(); /* to be on the save side */
BEGIN(CComment);
+ g_commentStack.push(new CommentCtx(g_lineNr));
}
}
<Scan>"--!" {
@@ -402,7 +420,9 @@ void replaceComment(int offset);
{
copyToOutput(yytext,(int)yyleng);
g_nestingCount=0;
+ g_commentStack.clear(); /* to be on the save side */
BEGIN(CComment);
+ g_commentStack.push(new CommentCtx(g_lineNr));
}
}
<Scan>![><!] {
@@ -414,7 +434,9 @@ void replaceComment(int offset);
{
copyToOutput(yytext,(int)yyleng);
g_nestingCount=0;
+ g_commentStack.clear(); /* to be on the save side */
BEGIN(CComment);
+ g_commentStack.push(new CommentCtx(g_lineNr));
}
}
<CComment>"{@code"/[ \t\n] {
@@ -606,6 +628,7 @@ void replaceComment(int offset);
}
<CComment>"/"+"*" { /* nested C comment */
g_nestingCount++;
+ g_commentStack.push(new CommentCtx(g_lineNr));
copyToOutput(yytext,(int)yyleng);
}
<CComment>"*"+"/" { /* end of C comment */
@@ -623,6 +646,7 @@ void replaceComment(int offset);
else
{
g_nestingCount--;
+ CommentCtx *ctx = g_commentStack.pop();
}
}
}
@@ -951,6 +975,8 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
g_lineNr = 1;
g_condStack.clear();
g_condStack.setAutoDelete(TRUE);
+ g_commentStack.clear();
+ g_commentStack.setAutoDelete(TRUE);
printlex(yy_flex_debug, TRUE, __FILE__, fileName);
isFixedForm = FALSE;
@@ -962,7 +988,9 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
if (g_lang==SrcLangExt_Markdown)
{
g_nestingCount=0;
+ g_commentStack.clear(); /* to be on the save side */
BEGIN(CComment);
+ g_commentStack.push(new CommentCtx(g_lineNr));
}
else
{
@@ -979,9 +1007,20 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
}
if (g_nestingCount>0 || (YY_START==CComment && g_lang!=SrcLangExt_Markdown))
{
+ QString tmp= "(probable line reference: ";
+ bool first = TRUE;
+ while (!g_commentStack.isEmpty())
+ {
+ CommentCtx *ctx = g_commentStack.pop();
+ if (!first) tmp += ", ";
+ tmp += QString::number(ctx->lineNr);
+ first = FALSE;
+ }
+ tmp += ")";
warn(g_fileName,g_lineNr,"Reached end of file while still inside a (nested) comment. "
- "Nesting level %d",g_nestingCount+1); // add one for "normal" expected end of comment
+ "Nesting level %d %s",g_nestingCount+1,tmp.data()); // add one for "normal" expected end of comment
}
+ g_commentStack.clear();
if (Debug::isFlagSet(Debug::CommentCnv))
{
g_outBuf->at(g_outBuf->curPos())='\0';
diff --git a/src/config.xml b/src/config.xml
index e172345..f8d4a13 100644
--- a/src/config.xml
+++ b/src/config.xml
@@ -2689,6 +2689,15 @@ EXTRA_PACKAGES=times
]]>
</docs>
</option>
+ <option type='string' id='MAN_SUBDIR' format='string' defval='' depends='GENERATE_MAN'>
+ <docs>
+<![CDATA[
+ The \c MAN_SUBDIR tag determines the name of the directory created within \c MAN_OUTPUT
+ in which the man pages are placed. If defaults to man followed by \c MAN_EXTENSION
+ with the initial . removed.
+]]>
+ </docs>
+ </option>
<option type='bool' id='MAN_LINKS' defval='0' depends='GENERATE_MAN'>
<docs>
<![CDATA[
diff --git a/src/doxygen.sty b/src/doxygen.sty
index 199abf8..072104b 100644
--- a/src/doxygen.sty
+++ b/src/doxygen.sty
@@ -450,6 +450,10 @@
\textbf{#1} (\textnormal{#2}\,\pageref{#3})%
}
+% Used by @addindex
+\newcommand{\lcurly}{\{}
+\newcommand{\rcurly}{\}}
+
% Used for syntax highlighting
\definecolor{comment}{rgb}{0.5,0.0,0.0}
\definecolor{keyword}{rgb}{0.0,0.5,0.0}
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index 91064a3..bc8e5a5 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -44,6 +44,9 @@ static QCString escapeLabelName(const char *s)
case '%': result+="\\%"; break;
case '|': result+="\\texttt{\"|}"; break;
case '!': result+="\"!"; break;
+ case '{': result+="\\lcurly{}"; break;
+ case '}': result+="\\rcurly{}"; break;
+ case '~': result+="````~"; break; // to get it a bit better in index together with other special characters
default: result+=c;
}
}
@@ -79,6 +82,8 @@ QCString LatexDocVisitor::escapeMakeIndexChars(const char *s)
case '|': m_t << "\\texttt{\"|}"; break;
case '[': m_t << "["; break;
case ']': m_t << "]"; break;
+ case '{': m_t << "\\lcurly{}"; break;
+ case '}': m_t << "\\rcurly{}"; break;
default: str[0]=c; filter(str); break;
}
}
diff --git a/src/latexgen.cpp b/src/latexgen.cpp
index 8b8c835..04750f5 100644
--- a/src/latexgen.cpp
+++ b/src/latexgen.cpp
@@ -1375,8 +1375,10 @@ void LatexGenerator::startMemberDoc(const char *clname,
t << "}";
if (clname)
{
- t << "!" << clname << "@{";
- docify(clname);
+ t << "!";
+ escapeLabelName(clname);
+ t << "@{";
+ escapeMakeIndexChars(clname);
t << "}";
}
t << "}" << endl;
@@ -2013,13 +2015,18 @@ void LatexGenerator::escapeLabelName(const char *s)
{
switch (c)
{
+ case '|': t << "\\texttt{\"|}"; break;
+ case '!': t << "\"!"; break;
case '%': t << "\\%"; break;
+ case '{': t << "\\lcurly{}"; break;
+ case '}': t << "\\rcurly{}"; break;
+ case '~': t << "````~"; break; // to get it a bit better in index together with other special characters
// NOTE: adding a case here, means adding it to while below as well!
default:
i=0;
// collect as long string as possible, before handing it to docify
result[i++]=c;
- while ((c=*p) && c!='%')
+ while ((c=*p) && c!='|' && c!='!' && c!='%' && c!='{' && c!='}' && c!='~')
{
result[i++]=c;
p++;
@@ -2042,16 +2049,20 @@ void LatexGenerator::escapeMakeIndexChars(const char *s)
{
switch (c)
{
+ case '!': t << "\"!"; break;
case '"': t << "\"\""; break;
case '@': t << "\"@"; break;
+ case '|': t << "\\texttt{\"|}"; break;
case '[': t << "["; break;
case ']': t << "]"; break;
+ case '{': t << "\\lcurly{}"; break;
+ case '}': t << "\\rcurly{}"; break;
// NOTE: adding a case here, means adding it to while below as well!
default:
i=0;
// collect as long string as possible, before handing it to docify
result[i++]=c;
- while ((c=*p) && c!='"' && c!='@' && c!='[' && c!=']')
+ while ((c=*p) && c!='"' && c!='@' && c!='[' && c!=']' && c!='!' && c!='{' && c!='}' && c!='|')
{
result[i++]=c;
p++;
diff --git a/src/mangen.cpp b/src/mangen.cpp
index a50ee73..f1cc76a 100644
--- a/src/mangen.cpp
+++ b/src/mangen.cpp
@@ -64,9 +64,19 @@ static QCString getExtension()
return ext;
}
+static QCString getSubdir()
+{
+ QCString dir = Config_getString("MAN_SUBDIR");
+ if (dir.isEmpty())
+ {
+ dir = "man" + getExtension();
+ }
+ return dir;
+}
+
ManGenerator::ManGenerator() : OutputGenerator()
{
- dir=Config_getString("MAN_OUTPUT")+"/man" + getExtension();
+ dir=Config_getString("MAN_OUTPUT") + "/" + getSubdir();
firstCol=TRUE;
paragraph=TRUE;
col=0;
@@ -106,10 +116,10 @@ void ManGenerator::init()
err("Could not create output directory %s\n",manOutput.data());
exit(1);
}
- d.setPath(manOutput+"/man"+ext);
- if (!d.exists() && !d.mkdir(manOutput+"/man"+ext))
+ d.setPath(manOutput + "/" + getSubdir());
+ if (!d.exists() && !d.mkdir(manOutput + "/" + getSubdir()))
{
- err("Could not create output directory %s/man%s\n",manOutput.data(),ext.data());
+ err("Could not create output directory %s/%s\n",manOutput.data(), getSubdir().data());
exit(1);
}
createSubDirs(d);
@@ -445,7 +455,7 @@ void ManGenerator::startDoxyAnchor(const char *,const char *manName,
FTextStream linkstream;
linkstream.setDevice(&linkfile);
//linkstream.setEncoding(QTextStream::UnicodeUTF8);
- linkstream << ".so man" << getExtension() << "/" << buildFileName( manName ) << endl;
+ linkstream << ".so " << getSubdir() << "/" << buildFileName( manName ) << endl;
}
}
linkfile.close();
diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp
index 94afed7..846da31 100644
--- a/src/sqlite3gen.cpp
+++ b/src/sqlite3gen.cpp
@@ -77,9 +77,9 @@ const char *i_q_xrefs="INSERT OR REPLACE INTO xrefs "
static sqlite3_stmt *i_s_xrefs=0;
//////////////////////////////////////////////////////
const char *i_q_memberdef="INSERT OR REPLACE INTO memberdef "
- "( refid, prot, static, const, explicit, inline, final, sealed, new, optional, required, virt, mutable, initonly, readable, writable, gettable, settable, accessor, addable, removable, raisable, name, type, definition, argsstring, scope, initializer, kind, id_bfile, bline, bcolumn, id_file, line, column)"
+ "( refid, prot, static, const, explicit, inline, final, sealed, new, optional, required, virt, mutable, initonly, readable, writable, gettable, settable, accessor, addable, removable, raisable, name, type, definition, argsstring, scope, initializer, kind, id_bodyfile, bodystart, bodyend, id_file, line, column, detaileddescription, briefdescription, inbodydescription)"
"VALUES "
- "(:refid,:prot,:static,:const,:explicit,:inline,:final,:sealed,:new,:optional,:required,:virt,:mutable,:initonly,:readable,:writable,:gettable,:settable,:accessor,:addable,:removable,:raisable,:name,:type,:definition,:argsstring,:scope,:initializer,:kind,:id_bfile,:bline,:bcolumn,:id_file,:line,:column)";
+ "(:refid,:prot,:static,:const,:explicit,:inline,:final,:sealed,:new,:optional,:required,:virt,:mutable,:initonly,:readable,:writable,:gettable,:settable,:accessor,:addable,:removable,:raisable,:name,:type,:definition,:argsstring,:scope,:initializer,:kind,:id_bodyfile,:bodystart,:bodyend,:id_file,:line,:column,:detaileddescription,:briefdescription,:inbodydescription)";
const char *id_q_memberdef="SELECT id FROM memberdef WHERE refid=:refid and id is not null";
static sqlite3_stmt *id_s_memberdef=0;
static sqlite3_stmt *i_s_memberdef=0;
@@ -202,12 +202,16 @@ const char * schema_queries[][2] =
"raisable INTEGER,"
"kind INTEGER,"
"refid TEXT NOT NULL,"
- "id_bfile INTEGER,"
- "bline INTEGER,"
- "bcolumn INTEGER,"
+ "id_bodyfile INTEGER,"
+ "bodystart INTEGER,"
+ "bodyend INTEGER,"
"id_file INTEGER NOT NULL,"
"line INTEGER NOT NULL,"
- "column INTEGER NOT NULL)"
+ "column INTEGER NOT NULL,"
+ "detaileddescription TEXT,"
+ "briefdescription TEXT,"
+ "inbodydescription TEXT"
+ ")"
},
};
@@ -692,6 +696,12 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
bindTextParameter(i_s_memberdef,":scope",md->getScopeString().data(),FALSE);
}
+ // Brief and detail description
+
+ bindTextParameter(i_s_memberdef,":briefdescription",md->briefDescription(),FALSE);
+ bindTextParameter(i_s_memberdef,":detaileddescription",md->documentation(),FALSE);
+ bindTextParameter(i_s_memberdef,":inbodydescription",md->inbodyDocumentation(),FALSE);
+
// File location
if (md->getDefLine() != -1)
{
@@ -704,18 +714,16 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
if (md->getStartBodyLine()!=-1)
{
- int id_bfile = insertFile(db,md->getBodyDef()->absFilePath());
- if (id_bfile == -1)
+ int id_bodyfile = insertFile(db,md->getBodyDef()->absFilePath());
+ if (id_bodyfile == -1)
{
sqlite3_clear_bindings(i_s_memberdef);
}
else
{
- bindIntParameter(i_s_memberdef,":id_ibfile",id_bfile);
- bindIntParameter(i_s_memberdef,":bline",md->getStartBodyLine());
-
- // XXX implement getStartBodyColumn
- bindIntParameter(i_s_memberdef,":bcolumn",1);
+ bindIntParameter(i_s_memberdef,":id_bodyfile",id_bodyfile);
+ bindIntParameter(i_s_memberdef,":bodystart",md->getStartBodyLine());
+ bindIntParameter(i_s_memberdef,":bodyend",md->getEndBodyLine());
}
}
}
@@ -837,19 +845,19 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
BaseClassDef *bcd;
for (bcli.toFirst();(bcd=bcli.current());++bcli)
{
- bindTextParameter(i_s_basecompoundref,":refid",bcd->classDef->getOutputFileBase());
+ bindTextParameter(i_s_basecompoundref,":refid",bcd->classDef->getOutputFileBase(),FALSE);
bindIntParameter(i_s_basecompoundref,":prot",bcd->prot);
bindIntParameter(i_s_basecompoundref,":virt",bcd->virt);
if (!bcd->templSpecifiers.isEmpty())
{
- bindTextParameter(i_s_basecompoundref,":base",insertTemplateSpecifierInScope(bcd->classDef->name(),bcd->templSpecifiers));
+ bindTextParameter(i_s_basecompoundref,":base",insertTemplateSpecifierInScope(bcd->classDef->name(),bcd->templSpecifiers),FALSE);
}
else
{
- bindTextParameter(i_s_basecompoundref,":base",bcd->classDef->displayName());
+ bindTextParameter(i_s_basecompoundref,":base",bcd->classDef->displayName(),FALSE);
}
- bindTextParameter(i_s_basecompoundref,":derived",cd->displayName());
+ bindTextParameter(i_s_basecompoundref,":derived",cd->displayName(),FALSE);
if (-1==step(db,i_s_basecompoundref)) {
sqlite3_clear_bindings(i_s_basecompoundref);
continue;