summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/docbookvisitor.cpp5
-rw-r--r--src/docparser.cpp23
-rw-r--r--src/docparser.h17
-rw-r--r--src/htmldocvisitor.cpp18
-rw-r--r--src/latexdocvisitor.cpp8
-rw-r--r--src/mandocvisitor.cpp9
-rw-r--r--src/perlmodgen.cpp1
-rw-r--r--src/rtfdocvisitor.cpp9
-rw-r--r--src/xmldocvisitor.cpp3
9 files changed, 54 insertions, 39 deletions
diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp
index 076b96d..28f6229 100644
--- a/src/docbookvisitor.cpp
+++ b/src/docbookvisitor.cpp
@@ -408,9 +408,8 @@ DB_VIS_C
m_t << "</computeroutput></literallayout>";
break;
case DocInclude::DontInclude:
- break;
+ case DocInclude::DontIncWithLines:
case DocInclude::HtmlInclude:
- break;
case DocInclude::LatexInclude:
break;
case DocInclude::VerbInclude:
@@ -495,7 +494,7 @@ DB_VIS_C
-1, // endLine
FALSE, // inline fragment
0, // memberDef
- op->lineno() // show line numbers
+ op->showLineNo() // show line numbers
);
if (fd) delete fd;
}
diff --git a/src/docparser.cpp b/src/docparser.cpp
index 6397bb8..1c8479b 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -113,7 +113,7 @@ static QCString g_includeFileText;
static uint g_includeFileOffset;
static uint g_includeFileLength;
static uint g_includeFileLine;
-static bool g_includeFileLineNo;
+static bool g_includeFileShowLineNo;
/** Parser's context to store all global variables.
@@ -195,7 +195,7 @@ static void docParserPushContext(bool saveParamInfo=TRUE)
ctx->includeFileOffset = g_includeFileOffset;
ctx->includeFileLength = g_includeFileLength;
ctx->includeFileLine = g_includeFileLine;
- ctx->includeFileLineNo = g_includeFileLineNo;
+ ctx->includeFileLineNo = g_includeFileShowLineNo;
ctx->token = g_token;
g_token = new TokenInfo;
@@ -235,7 +235,7 @@ static void docParserPopContext(bool keepParamInfo=FALSE)
g_includeFileOffset = ctx->includeFileOffset;
g_includeFileLength = ctx->includeFileLength;
g_includeFileLine = ctx->includeFileLine;
- g_includeFileLineNo = ctx->includeFileLineNo;
+ g_includeFileShowLineNo = ctx->includeFileLineNo;
delete g_token;
g_token = ctx->token;
@@ -2025,7 +2025,7 @@ void DocInclude::parse()
g_includeFileOffset = 0;
g_includeFileLength = m_text.length();
g_includeFileLine = 0;
- g_includeFileLineNo = (m_type == DontIncWithLines || m_type == IncWithLines);
+ g_includeFileShowLineNo = (m_type == DontIncWithLines || m_type == IncWithLines);
//printf("g_includeFile=<<%s>>\n",g_includeFileText.data());
break;
case VerbInclude:
@@ -2060,6 +2060,13 @@ void DocInclude::parse()
void DocIncOperator::parse()
{
+ if (g_includeFileName.isEmpty())
+ {
+ warn_doc_error(g_fileName,doctokenizerYYlineno,
+ "No previous '\\include' or \\dontinclude' command for '\\%s' present",
+ typeAsString());
+ }
+
m_includeFileName = g_includeFileName;
const char *p = g_includeFileText;
uint l = g_includeFileLength;
@@ -2093,7 +2100,7 @@ void DocIncOperator::parse()
DBG(("DocIncOperator::parse() Line: %s\n",qPrint(m_text)));
}
g_includeFileOffset = QMIN(l,o+1); // set pointer to start of new line
- m_lineno = g_includeFileLineNo;
+ m_showLineNo = g_includeFileShowLineNo;
break;
case SkipLine:
while (o<l)
@@ -2124,7 +2131,7 @@ void DocIncOperator::parse()
o++; // skip new line
}
g_includeFileOffset = QMIN(l,o+1); // set pointer to start of new line
- m_lineno = g_includeFileLineNo;
+ m_showLineNo = g_includeFileShowLineNo;
break;
case Skip:
while (o<l)
@@ -2152,7 +2159,7 @@ void DocIncOperator::parse()
o++; // skip new line
}
g_includeFileOffset = so; // set pointer to start of new line
- m_lineno = g_includeFileLineNo;
+ m_showLineNo = g_includeFileShowLineNo;
break;
case Until:
bo=o;
@@ -2184,7 +2191,7 @@ void DocIncOperator::parse()
o++; // skip new line
}
g_includeFileOffset = QMIN(l,o+1); // set pointer to start of new line
- m_lineno = g_includeFileLineNo;
+ m_showLineNo = g_includeFileShowLineNo;
break;
}
}
diff --git a/src/docparser.h b/src/docparser.h
index 1beadcd..15180f9 100644
--- a/src/docparser.h
+++ b/src/docparser.h
@@ -608,13 +608,24 @@ class DocIncOperator : public DocNode
enum Type { Line, SkipLine, Skip, Until };
DocIncOperator(DocNode *parent,Type t,const QCString &pat,
const QCString &context,bool isExample,const QCString &exampleFile) :
- m_type(t), m_pattern(pat), m_context(context),
+ m_type(t), m_pattern(pat), m_context(context),
m_isFirst(FALSE), m_isLast(FALSE),
m_isExample(isExample), m_exampleFile(exampleFile) { m_parent = parent; }
Kind kind() const { return Kind_IncOperator; }
Type type() const { return m_type; }
+ const char *typeAsString() const
+ {
+ switch(m_type)
+ {
+ case Line: return "line";
+ case SkipLine: return "skipline";
+ case Skip: return "skip";
+ case Until: return "until";
+ }
+ return "";
+ }
int line() const { return m_line; }
- bool lineno() const { return m_lineno; }
+ bool showLineNo() const { return m_showLineNo; }
QCString text() const { return m_text; }
QCString pattern() const { return m_pattern; }
QCString context() const { return m_context; }
@@ -631,7 +642,7 @@ class DocIncOperator : public DocNode
private:
Type m_type;
int m_line;
- bool m_lineno;
+ bool m_showLineNo;
QCString m_text;
QCString m_pattern;
QCString m_context;
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp
index 881680e..f405591 100644
--- a/src/htmldocvisitor.cpp
+++ b/src/htmldocvisitor.cpp
@@ -670,7 +670,9 @@ void HtmlDocVisitor::visit(DocInclude *inc)
forceStartParagraph(inc);
}
break;
- case DocInclude::DontInclude:
+ case DocInclude::DontInclude:
+ case DocInclude::LatexInclude:
+ case DocInclude::DontIncWithLines:
break;
case DocInclude::HtmlInclude:
{
@@ -679,8 +681,6 @@ void HtmlDocVisitor::visit(DocInclude *inc)
if (inc->isBlock()) forceStartParagraph(inc);
}
break;
- case DocInclude::LatexInclude:
- break;
case DocInclude::VerbInclude:
forceEndParagraph(inc);
m_t << /*PREFRAG_START <<*/ "<pre class=\"fragment\">";
@@ -781,7 +781,7 @@ void HtmlDocVisitor::visit(DocIncOperator *op)
-1, // endLine
FALSE, // inline fragment
0, // memberDef
- op->lineno(), // show line numbers
+ op->showLineNo(), // show line numbers
m_ctx // search context
);
if (fd) delete fd;
@@ -2384,16 +2384,14 @@ void HtmlDocVisitor::forceEndParagraph(DocNode *n)
DocPara *para = (DocPara*)n->parent();
int nodeIndex = para->children().findRef(n);
nodeIndex--;
- if (nodeIndex<0) return; // first node
+ if (nodeIndex<0) return; // first node in paragraph
while (nodeIndex>=0 && isInvisibleNode(para->children().at(nodeIndex)))
{
nodeIndex--;
}
- if (nodeIndex>=0)
- {
- DocNode *n = para->children().at(nodeIndex);
- if (mustBeOutsideParagraph(n)) return;
- }
+ if (nodeIndex<0) return; // first visible node in paragraph
+ DocNode *n = para->children().at(nodeIndex);
+ if (mustBeOutsideParagraph(n)) return; // previous node already outside paragraph context
nodeIndex--;
bool styleOutsideParagraph=insideStyleChangeThatIsOutsideParagraph(para,nodeIndex);
bool isFirst;
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index 31f05ad..2e979bd 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -494,9 +494,9 @@ void LatexDocVisitor::visit(DocInclude *inc)
LatexCodeGenerator::setDoxyCodeOpen(FALSE);
m_t << "\\end{DoxyCodeInclude}\n";
break;
- case DocInclude::DontInclude:
- break;
- case DocInclude::HtmlInclude:
+ case DocInclude::DontInclude:
+ case DocInclude::DontIncWithLines:
+ case DocInclude::HtmlInclude:
break;
case DocInclude::LatexInclude:
m_t << inc->text();
@@ -587,7 +587,7 @@ void LatexDocVisitor::visit(DocIncOperator *op)
-1, // endLine
FALSE, // inline fragment
0, // memberDef
- op->lineno() // show line numbers
+ op->showLineNo() // show line numbers
);
if (fd) delete fd;
}
diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp
index 1c5cfec..5c98c6f 100644
--- a/src/mandocvisitor.cpp
+++ b/src/mandocvisitor.cpp
@@ -297,10 +297,9 @@ void ManDocVisitor::visit(DocInclude *inc)
m_t << ".PP" << endl;
m_firstCol=TRUE;
break;
- case DocInclude::DontInclude:
- break;
- case DocInclude::HtmlInclude:
- break;
+ case DocInclude::DontInclude:
+ case DocInclude::DontIncWithLines:
+ case DocInclude::HtmlInclude:
case DocInclude::LatexInclude:
break;
case DocInclude::VerbInclude:
@@ -402,7 +401,7 @@ void ManDocVisitor::visit(DocIncOperator *op)
-1, // endLine
FALSE, // inline fragment
0, // memberDef
- op->lineno() // show line numbers
+ op->showLineNo() // show line numbers
);
if (fd) delete fd;
}
diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp
index fcc7ef5..1ec4bf3 100644
--- a/src/perlmodgen.cpp
+++ b/src/perlmodgen.cpp
@@ -729,6 +729,7 @@ void PerlModDocVisitor::visit(DocInclude *inc)
#endif
return;
case DocInclude::DontInclude: return;
+ case DocInclude::DontIncWithLines: return;
case DocInclude::HtmlInclude: type = "htmlonly"; break;
case DocInclude::LatexInclude: type = "latexonly"; break;
case DocInclude::VerbInclude: type = "preformatted"; break;
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp
index 00ccc0e..55c03a5 100644
--- a/src/rtfdocvisitor.cpp
+++ b/src/rtfdocvisitor.cpp
@@ -466,10 +466,9 @@ void RTFDocVisitor::visit(DocInclude *inc)
m_t << "\\par";
m_t << "}" << endl;
break;
- case DocInclude::DontInclude:
- break;
- case DocInclude::HtmlInclude:
- break;
+ case DocInclude::DontInclude:
+ case DocInclude::DontIncWithLines:
+ case DocInclude::HtmlInclude:
case DocInclude::LatexInclude:
break;
case DocInclude::VerbInclude:
@@ -565,7 +564,7 @@ void RTFDocVisitor::visit(DocIncOperator *op)
-1, // endLine
FALSE, // inline fragment
0, // memberDef
- op->lineno() // show line numbers
+ op->showLineNo() // show line numbers
);
if (fd) delete fd;
}
diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp
index 5099f67..1005719 100644
--- a/src/xmldocvisitor.cpp
+++ b/src/xmldocvisitor.cpp
@@ -335,6 +335,7 @@ void XmlDocVisitor::visit(DocInclude *inc)
m_t << "</programlisting>";
break;
case DocInclude::DontInclude:
+ case DocInclude::DontIncWithLines:
break;
case DocInclude::HtmlInclude:
if (inc->isBlock())
@@ -436,7 +437,7 @@ void XmlDocVisitor::visit(DocIncOperator *op)
-1, // endLine
FALSE, // inline fragment
0, // memberDef
- op->lineno() // show line numbers
+ op->showLineNo() // show line numbers
);
if (fd) delete fd;
}