summaryrefslogtreecommitdiff
path: root/src/docparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/docparser.cpp')
-rw-r--r--src/docparser.cpp358
1 files changed, 134 insertions, 224 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp
index 4a18b4e..e5e2895 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -3,7 +3,7 @@
*
*
*
- * Copyright (C) 1997-2013 by Dimitri van Heesch.
+ * Copyright (C) 1997-2014 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
@@ -53,6 +53,7 @@
#include "config.h"
#include "growbuf.h"
#include "markdown.h"
+#include "htmlentity.h"
// debug off
#define DBG(x) do {} while(0)
@@ -1244,34 +1245,43 @@ reparsetoken:
switch (Mappers::cmdMapper->map(tokenName))
{
case CMD_BSLASH:
- children.append(new DocSymbol(parent,DocSymbol::BSlash));
+ children.append(new DocSymbol(parent,DocSymbol::Sym_BSlash));
break;
case CMD_AT:
- children.append(new DocSymbol(parent,DocSymbol::At));
+ children.append(new DocSymbol(parent,DocSymbol::Sym_At));
break;
case CMD_LESS:
- children.append(new DocSymbol(parent,DocSymbol::Less));
+ children.append(new DocSymbol(parent,DocSymbol::Sym_Less));
break;
case CMD_GREATER:
- children.append(new DocSymbol(parent,DocSymbol::Greater));
+ children.append(new DocSymbol(parent,DocSymbol::Sym_Greater));
break;
case CMD_AMP:
- children.append(new DocSymbol(parent,DocSymbol::Amp));
+ children.append(new DocSymbol(parent,DocSymbol::Sym_Amp));
break;
case CMD_DOLLAR:
- children.append(new DocSymbol(parent,DocSymbol::Dollar));
+ children.append(new DocSymbol(parent,DocSymbol::Sym_Dollar));
break;
case CMD_HASH:
- children.append(new DocSymbol(parent,DocSymbol::Hash));
+ children.append(new DocSymbol(parent,DocSymbol::Sym_Hash));
break;
case CMD_DCOLON:
- children.append(new DocSymbol(parent,DocSymbol::DoubleColon));
+ children.append(new DocSymbol(parent,DocSymbol::Sym_DoubleColon));
break;
case CMD_PERCENT:
- children.append(new DocSymbol(parent,DocSymbol::Percent));
+ children.append(new DocSymbol(parent,DocSymbol::Sym_Percent));
+ break;
+ case CMD_NDASH:
+ children.append(new DocSymbol(parent,DocSymbol::Sym_Minus));
+ children.append(new DocSymbol(parent,DocSymbol::Sym_Minus));
+ break;
+ case CMD_MDASH:
+ children.append(new DocSymbol(parent,DocSymbol::Sym_Minus));
+ children.append(new DocSymbol(parent,DocSymbol::Sym_Minus));
+ children.append(new DocSymbol(parent,DocSymbol::Sym_Minus));
break;
case CMD_QUOTE:
- children.append(new DocSymbol(parent,DocSymbol::Quot));
+ children.append(new DocSymbol(parent,DocSymbol::Sym_Quot));
break;
case CMD_EMPHASIS:
{
@@ -1319,7 +1329,7 @@ reparsetoken:
{
doctokenizerYYsetStateHtmlOnly();
tok = doctokenizerYYlex();
- children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::HtmlOnly,g_isExample,g_exampleName));
+ children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::HtmlOnly,g_isExample,g_exampleName,g_token->name=="block"));
if (tok==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"htmlonly section ended without end marker");
doctokenizerYYsetStatePara();
}
@@ -1488,11 +1498,10 @@ reparsetoken:
break;
case TK_SYMBOL:
{
- char letter='\0';
- DocSymbol::SymType s = DocSymbol::decodeSymbol(tokenName,&letter);
- if (s!=DocSymbol::Unknown)
+ DocSymbol::SymType s = DocSymbol::decodeSymbol(tokenName);
+ if (s!=DocSymbol::Sym_Unknown)
{
- children.append(new DocSymbol(parent,s,letter));
+ children.append(new DocSymbol(parent,s));
}
else
{
@@ -1571,138 +1580,10 @@ static void handleImg(DocNode *parent,QList<DocNode> &children,const HtmlAttribL
//---------------------------------------------------------------------------
-DocSymbol::SymType DocSymbol::decodeSymbol(const QCString &symName,char *letter)
-{
- int l=symName.length();
- DBG(("decodeSymbol(%s) l=%d\n",qPrint(symName),l));
- // TODO: replace this with a hash
- if (symName=="&copy;") return DocSymbol::Copy;
- else if (symName=="&trade;") return DocSymbol::Tm;
- else if (symName=="&tm;") return DocSymbol::Tm; // alias for &trade;
- else if (symName=="&reg;") return DocSymbol::Reg;
- else if (symName=="&lt;") return DocSymbol::Less;
- else if (symName=="&gt;") return DocSymbol::Greater;
- else if (symName=="&amp;") return DocSymbol::Amp;
- else if (symName=="&apos;") return DocSymbol::Apos;
- else if (symName=="&quot;") return DocSymbol::Quot;
- else if (symName=="&lsquo;") return DocSymbol::Lsquo;
- else if (symName=="&rsquo;") return DocSymbol::Rsquo;
- else if (symName=="&ldquo;") return DocSymbol::Ldquo;
- else if (symName=="&rdquo;") return DocSymbol::Rdquo;
- else if (symName=="&ndash;") return DocSymbol::Ndash;
- else if (symName=="&mdash;") return DocSymbol::Mdash;
- else if (symName=="&szlig;") return DocSymbol::Szlig;
- else if (symName=="&nbsp;") return DocSymbol::Nbsp;
- else if (symName=="&AElig;") return DocSymbol::AElig;
- else if (symName=="&aelig;") return DocSymbol::Aelig;
- else if (symName=="&Gamma;") return DocSymbol::GrkGamma;
- else if (symName=="&Delta;") return DocSymbol::GrkDelta;
- else if (symName=="&Theta;") return DocSymbol::GrkTheta;
- else if (symName=="&Lambda;") return DocSymbol::GrkLambda;
- else if (symName=="&Xi;") return DocSymbol::GrkXi;
- else if (symName=="&Pi;") return DocSymbol::GrkPi;
- else if (symName=="&Sigma;") return DocSymbol::GrkSigma;
- else if (symName=="&Upsilon;") return DocSymbol::GrkUpsilon;
- else if (symName=="&Phi;") return DocSymbol::GrkPhi;
- else if (symName=="&Psi;") return DocSymbol::GrkPsi;
- else if (symName=="&Omega;") return DocSymbol::GrkOmega;
- else if (symName=="&alpha;") return DocSymbol::Grkalpha;
- else if (symName=="&beta;") return DocSymbol::Grkbeta;
- else if (symName=="&gamma;") return DocSymbol::Grkgamma;
- else if (symName=="&delta;") return DocSymbol::Grkdelta;
- else if (symName=="&epsilon;") return DocSymbol::Grkepsilon;
- else if (symName=="&zeta;") return DocSymbol::Grkzeta;
- else if (symName=="&eta;") return DocSymbol::Grketa;
- else if (symName=="&theta;") return DocSymbol::Grktheta;
- else if (symName=="&iota;") return DocSymbol::Grkiota;
- else if (symName=="&kappa;") return DocSymbol::Grkkappa;
- else if (symName=="&lambda;") return DocSymbol::Grklambda;
- else if (symName=="&mu;") return DocSymbol::Grkmu;
- else if (symName=="&nu;") return DocSymbol::Grknu;
- else if (symName=="&xi;") return DocSymbol::Grkxi;
- else if (symName=="&pi;") return DocSymbol::Grkpi;
- else if (symName=="&rho;") return DocSymbol::Grkrho;
- else if (symName=="&sigma;") return DocSymbol::Grksigma;
- else if (symName=="&tau;") return DocSymbol::Grktau;
- else if (symName=="&upsilon;") return DocSymbol::Grkupsilon;
- else if (symName=="&phi;") return DocSymbol::Grkphi;
- else if (symName=="&chi;") return DocSymbol::Grkchi;
- else if (symName=="&psi;") return DocSymbol::Grkpsi;
- else if (symName=="&omega;") return DocSymbol::Grkomega;
- else if (symName=="&sigmaf;") return DocSymbol::Grkvarsigma;
- else if (symName=="&sect;") return DocSymbol::Section;
- else if (symName=="&deg;") return DocSymbol::Degree;
- else if (symName=="&prime;") return DocSymbol::Prime;
- else if (symName=="&Prime;") return DocSymbol::DoublePrime;
- else if (symName=="&infin;") return DocSymbol::Infinity;
- else if (symName=="&empty;") return DocSymbol::EmptySet;
- else if (symName=="&plusmn;") return DocSymbol::PlusMinus;
- else if (symName=="&times;") return DocSymbol::Times;
- else if (symName=="&minus;") return DocSymbol::Minus;
- else if (symName=="&sdot;") return DocSymbol::CenterDot;
- else if (symName=="&part;") return DocSymbol::Partial;
- else if (symName=="&nabla;") return DocSymbol::Nabla;
- else if (symName=="&radic;") return DocSymbol::SquareRoot;
- else if (symName=="&perp;") return DocSymbol::Perpendicular;
- else if (symName=="&sum;") return DocSymbol::Sum;
- else if (symName=="&int;") return DocSymbol::Integral;
- else if (symName=="&prod;") return DocSymbol::Product;
- else if (symName=="&sim;") return DocSymbol::Similar;
- else if (symName=="&asymp;") return DocSymbol::Approx;
- else if (symName=="&ne;") return DocSymbol::NotEqual;
- else if (symName=="&equiv;") return DocSymbol::Equivalent;
- else if (symName=="&prop;") return DocSymbol::Proportional;
- else if (symName=="&le;") return DocSymbol::LessEqual;
- else if (symName=="&ge;") return DocSymbol::GreaterEqual;
- else if (symName=="&larr;") return DocSymbol::LeftArrow;
- else if (symName=="&rarr;") return DocSymbol::RightArrow;
- else if (symName=="&isin;") return DocSymbol::SetIn;
- else if (symName=="&notin;") return DocSymbol::SetNotIn;
- else if (symName=="&lceil;") return DocSymbol::LeftCeil;
- else if (symName=="&rceil;") return DocSymbol::RightCeil;
- else if (symName=="&lfloor;") return DocSymbol::LeftFloor;
- else if (symName=="&rfloor;") return DocSymbol::RightFloor;
- else if (l==6 && symName.right(4)=="uml;")
- {
- *letter=symName.at(1);
- return DocSymbol::Uml;
- }
- else if (l==8 && symName.right(6)=="acute;")
- {
- *letter=symName.at(1);
- return DocSymbol::Acute;
- }
- else if (l==8 && symName.right(6)=="grave;")
- {
- *letter=symName.at(1);
- return DocSymbol::Grave;
- }
- else if (l==7 && symName.right(5)=="circ;")
- {
- *letter=symName.at(1);
- return DocSymbol::Circ;
- }
- else if (l==8 && symName.right(6)=="tilde;")
- {
- *letter=symName.at(1);
- return DocSymbol::Tilde;
- }
- else if (l==8 && symName.right(6)=="cedil;")
- {
- *letter=symName.at(1);
- return DocSymbol::Cedil;
- }
- else if (l==7 && symName.right(5)=="ring;")
- {
- *letter=symName.at(1);
- return DocSymbol::Ring;
- }
- else if (l==8 && symName.right(6)=="slash;")
- {
- *letter=symName.at(1);
- return DocSymbol::Slash;
- }
- return DocSymbol::Unknown;
+DocSymbol::SymType DocSymbol::decodeSymbol(const QCString &symName)
+{
+ DBG(("decodeSymbol(%s)\n",qPrint(symName)));
+ return HtmlEntityMapper::instance()->name2sym(symName);
}
//---------------------------------------------------------------------------
@@ -1719,9 +1600,9 @@ static int internalValidatingParseDoc(DocNode *parent,QList<DocNode> &children,
// first parse any number of paragraphs
bool isFirst=TRUE;
DocPara *lastPar=0;
- if (!children.isEmpty() && children.last()->kind()==DocNode::Kind_Para)
+ if (!children.isEmpty() && children.getLast()->kind()==DocNode::Kind_Para)
{ // last child item was a paragraph
- lastPar = (DocPara*)children.last();
+ lastPar = (DocPara*)children.getLast();
isFirst=FALSE;
}
do
@@ -1873,12 +1754,12 @@ DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor)
DocVerbatim::DocVerbatim(DocNode *parent,const QCString &context,
const QCString &text, Type t,bool isExample,
- const QCString &exampleFile,const QCString &lang)
+ const QCString &exampleFile,bool isBlock,const QCString &lang)
: m_context(context), m_text(text), m_type(t),
- m_isExample(isExample), m_exampleFile(exampleFile),
- m_relPath(g_relPath), m_lang(lang)
-{
- m_parent = parent;
+ m_isExample(isExample), m_exampleFile(exampleFile),
+ m_relPath(g_relPath), m_lang(lang), m_isBlock(isBlock)
+{
+ m_parent = parent;
}
@@ -1905,6 +1786,9 @@ void DocInclude::parse()
case HtmlInclude:
readTextFileByName(m_file,m_text);
break;
+ case LatexInclude:
+ readTextFileByName(m_file,m_text);
+ break;
case Snippet:
readTextFileByName(m_file,m_text);
// check here for the existence of the blockId inside the file, so we
@@ -3369,26 +3253,25 @@ int DocIndexEntry::parse()
break;
case TK_SYMBOL:
{
- char letter='\0';
- DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name,&letter);
+ DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name);
switch (s)
{
- case DocSymbol::BSlash: m_entry+='\\'; break;
- case DocSymbol::At: m_entry+='@'; break;
- case DocSymbol::Less: m_entry+='<'; break;
- case DocSymbol::Greater: m_entry+='>'; break;
- case DocSymbol::Amp: m_entry+='&'; break;
- case DocSymbol::Dollar: m_entry+='$'; break;
- case DocSymbol::Hash: m_entry+='#'; break;
- case DocSymbol::Percent: m_entry+='%'; break;
- case DocSymbol::Apos: m_entry+='\''; break;
- case DocSymbol::Quot: m_entry+='"'; break;
- case DocSymbol::Lsquo: m_entry+='`'; break;
- case DocSymbol::Rsquo: m_entry+='\''; break;
- case DocSymbol::Ldquo: m_entry+="``"; break;
- case DocSymbol::Rdquo: m_entry+="''"; break;
- case DocSymbol::Ndash: m_entry+="--"; break;
- case DocSymbol::Mdash: m_entry+="---"; break;
+ case DocSymbol::Sym_BSlash: m_entry+='\\'; break;
+ case DocSymbol::Sym_At: m_entry+='@'; break;
+ case DocSymbol::Sym_Less: m_entry+='<'; break;
+ case DocSymbol::Sym_Greater: m_entry+='>'; break;
+ case DocSymbol::Sym_Amp: m_entry+='&'; break;
+ case DocSymbol::Sym_Dollar: m_entry+='$'; break;
+ case DocSymbol::Sym_Hash: m_entry+='#'; break;
+ case DocSymbol::Sym_Percent: m_entry+='%'; break;
+ case DocSymbol::Sym_apos: m_entry+='\''; break;
+ case DocSymbol::Sym_Quot: m_entry+='"'; break;
+ case DocSymbol::Sym_lsquo: m_entry+='`'; break;
+ case DocSymbol::Sym_rsquo: m_entry+='\''; break;
+ case DocSymbol::Sym_ldquo: m_entry+="``"; break;
+ case DocSymbol::Sym_rdquo: m_entry+="''"; break;
+ case DocSymbol::Sym_ndash: m_entry+="--"; break;
+ case DocSymbol::Sym_mdash: m_entry+="---"; break;
default:
warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected symbol found as argument of \\addindex");
break;
@@ -3407,6 +3290,8 @@ int DocIndexEntry::parse()
case CMD_HASH: m_entry+='#'; break;
case CMD_DCOLON: m_entry+="::"; break;
case CMD_PERCENT: m_entry+='%'; break;
+ case CMD_NDASH: m_entry+="--"; break;
+ case CMD_MDASH: m_entry+="---"; break;
case CMD_QUOTE: m_entry+='"'; break;
default:
warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected command %s found as argument of \\addindex",
@@ -4654,8 +4539,8 @@ int DocSimpleSect::parse(bool userTitle,bool needsSeparator)
}
else
{
- ASSERT(m_children.last()->kind()==DocNode::Kind_Para);
- ((DocPara *)m_children.last())->markLast(FALSE);
+ ASSERT(m_children.getLast()->kind()==DocNode::Kind_Para);
+ ((DocPara *)m_children.getLast())->markLast(FALSE);
}
par->markLast();
if (needsSeparator) m_children.append(new DocSimpleSectSep(this));
@@ -4705,8 +4590,8 @@ int DocSimpleSect::parseXml()
}
else
{
- ASSERT(m_children.last()->kind()==DocNode::Kind_Para);
- ((DocPara *)m_children.last())->markLast(FALSE);
+ ASSERT(m_children.getLast()->kind()==DocNode::Kind_Para);
+ ((DocPara *)m_children.getLast())->markLast(FALSE);
}
par->markLast();
m_children.append(par);
@@ -4730,14 +4615,14 @@ int DocSimpleSect::parseXml()
void DocSimpleSect::appendLinkWord(const QCString &word)
{
DocPara *p;
- if (m_children.isEmpty() || m_children.last()->kind()!=DocNode::Kind_Para)
+ if (m_children.isEmpty() || m_children.getLast()->kind()!=DocNode::Kind_Para)
{
p = new DocPara(this);
m_children.append(p);
}
else
{
- p = (DocPara *)m_children.last();
+ p = (DocPara *)m_children.getLast();
// Comma-seperate <seealso> links.
p->injectToken(TK_WORD,",");
@@ -4881,7 +4766,7 @@ int DocParamList::parseXml(const QCString &paramName)
}
else
{
- m_paragraphs.last()->markLast(FALSE);
+ m_paragraphs.getLast()->markLast(FALSE);
}
par->markLast();
m_paragraphs.append(par);
@@ -4932,8 +4817,8 @@ int DocParamSect::parse(const QCString &cmdName,bool xmlContext, Direction d)
}
else
{
- ASSERT(m_children.last()->kind()==DocNode::Kind_ParamList);
- ((DocParamList *)m_children.last())->markLast(FALSE);
+ ASSERT(m_children.getLast()->kind()==DocNode::Kind_ParamList);
+ ((DocParamList *)m_children.getLast())->markLast(FALSE);
pl->markLast();
}
m_children.append(pl);
@@ -4945,6 +4830,10 @@ int DocParamSect::parse(const QCString &cmdName,bool xmlContext, Direction d)
{
retval = pl->parse(cmdName);
}
+ if (retval==RetVal_EndParBlock)
+ {
+ retval = RetVal_OK;
+ }
DBG(("DocParamSect::parse() end retval=%d\n",retval));
DocNode *n=g_nodeStack.pop();
@@ -4959,12 +4848,12 @@ int DocPara::handleSimpleSection(DocSimpleSect::Type t, bool xmlContext)
DocSimpleSect *ss=0;
bool needsSeparator = FALSE;
if (!m_children.isEmpty() && // previous element
- m_children.last()->kind()==Kind_SimpleSect && // was a simple sect
- ((DocSimpleSect *)m_children.last())->type()==t && // of same type
+ m_children.getLast()->kind()==Kind_SimpleSect && // was a simple sect
+ ((DocSimpleSect *)m_children.getLast())->type()==t && // of same type
t!=DocSimpleSect::User) // but not user defined
{
// append to previous section
- ss=(DocSimpleSect *)m_children.last();
+ ss=(DocSimpleSect *)m_children.getLast();
needsSeparator = TRUE;
}
else // start new section
@@ -4991,11 +4880,11 @@ int DocPara::handleParamSection(const QCString &cmdName,
{
DocParamSect *ps=0;
if (!m_children.isEmpty() && // previous element
- m_children.last()->kind()==Kind_ParamSect && // was a param sect
- ((DocParamSect *)m_children.last())->type()==t) // of same type
+ m_children.getLast()->kind()==Kind_ParamSect && // was a param sect
+ ((DocParamSect *)m_children.getLast())->type()==t) // of same type
{
// append to previous section
- ps=(DocParamSect *)m_children.last();
+ ps=(DocParamSect *)m_children.getLast();
}
else // start new section
{
@@ -5086,13 +4975,15 @@ void DocPara::handleIncludeOperator(const QCString &cmdName,DocIncOperator::Type
return;
}
DocIncOperator *op = new DocIncOperator(this,t,g_token->name,g_context,g_isExample,g_exampleName);
- DocNode *n1 = m_children.last();
- DocNode *n2 = n1!=0 ? m_children.prev() : 0;
+ QListIterator<DocNode> it(m_children);
+ DocNode *n1 = it.toLast();
+ --it;
+ DocNode *n2 = n1!=0 ? it.current() : 0;
bool isFirst = n1==0 || // no last node
- (n1->kind()!=DocNode::Kind_IncOperator &&
+ (n1->kind()!=DocNode::Kind_IncOperator &&
n1->kind()!=DocNode::Kind_WhiteSpace
) || // last node is not operator or whitespace
- (n1->kind()==DocNode::Kind_WhiteSpace &&
+ (n1->kind()==DocNode::Kind_WhiteSpace &&
n2!=0 && n2->kind()!=DocNode::Kind_IncOperator
); // previous not is not operator
op->markFirst(isFirst);
@@ -5400,7 +5291,7 @@ int DocPara::handleStartCode()
if (g_token->verb.at(i)=='\n') li=i+1;
i++;
}
- m_children.append(new DocVerbatim(this,g_context,stripIndentation(g_token->verb.mid(li)),DocVerbatim::Code,g_isExample,g_exampleName,lang));
+ m_children.append(new DocVerbatim(this,g_context,stripIndentation(g_token->verb.mid(li)),DocVerbatim::Code,g_isExample,g_exampleName,FALSE,lang));
if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"code section ended without end marker");
doctokenizerYYsetStatePara();
return retval;
@@ -5464,37 +5355,46 @@ int DocPara::handleCommand(const QCString &cmdName)
if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," "));
break;
case CMD_BSLASH:
- m_children.append(new DocSymbol(this,DocSymbol::BSlash));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_BSlash));
break;
case CMD_AT:
- m_children.append(new DocSymbol(this,DocSymbol::At));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_At));
break;
case CMD_LESS:
- m_children.append(new DocSymbol(this,DocSymbol::Less));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Less));
break;
case CMD_GREATER:
- m_children.append(new DocSymbol(this,DocSymbol::Greater));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Greater));
break;
case CMD_AMP:
- m_children.append(new DocSymbol(this,DocSymbol::Amp));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Amp));
break;
case CMD_DOLLAR:
- m_children.append(new DocSymbol(this,DocSymbol::Dollar));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Dollar));
break;
case CMD_HASH:
- m_children.append(new DocSymbol(this,DocSymbol::Hash));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Hash));
break;
case CMD_PIPE:
- m_children.append(new DocSymbol(this,DocSymbol::Pipe));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Pipe));
break;
case CMD_DCOLON:
- m_children.append(new DocSymbol(this,DocSymbol::DoubleColon));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_DoubleColon));
break;
case CMD_PERCENT:
- m_children.append(new DocSymbol(this,DocSymbol::Percent));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Percent));
+ break;
+ case CMD_NDASH:
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
+ break;
+ case CMD_MDASH:
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
break;
case CMD_QUOTE:
- m_children.append(new DocSymbol(this,DocSymbol::Quot));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Quot));
break;
case CMD_SA:
g_inSeeBlock=TRUE;
@@ -5588,7 +5488,7 @@ int DocPara::handleCommand(const QCString &cmdName)
{
doctokenizerYYsetStateHtmlOnly();
retval = doctokenizerYYlex();
- m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::HtmlOnly,g_isExample,g_exampleName));
+ m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::HtmlOnly,g_isExample,g_exampleName,g_token->name=="block"));
if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"htmlonly section ended without end marker");
doctokenizerYYsetStatePara();
}
@@ -5751,6 +5651,9 @@ int DocPara::handleCommand(const QCString &cmdName)
case CMD_HTMLINCLUDE:
handleInclude(cmdName,DocInclude::HtmlInclude);
break;
+ case CMD_LATEXINCLUDE:
+ handleInclude(cmdName,DocInclude::LatexInclude);
+ break;
case CMD_VERBINCLUDE:
handleInclude(cmdName,DocInclude::VerbInclude);
break;
@@ -6468,7 +6371,7 @@ reparsetoken:
// remove leading whitespace
!m_children.isEmpty() &&
// and whitespace after certain constructs
- (k=m_children.last()->kind())!=DocNode::Kind_HtmlDescList &&
+ (k=m_children.getLast()->kind())!=DocNode::Kind_HtmlDescList &&
k!=DocNode::Kind_HtmlTable &&
k!=DocNode::Kind_HtmlList &&
k!=DocNode::Kind_SimpleSect &&
@@ -6685,11 +6588,10 @@ reparsetoken:
break;
case TK_SYMBOL:
{
- char letter='\0';
- DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name,&letter);
- if (s!=DocSymbol::Unknown)
+ DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name);
+ if (s!=DocSymbol::Sym_Unknown)
{
- m_children.append(new DocSymbol(this,s,letter));
+ m_children.append(new DocSymbol(this,s));
}
else
{
@@ -6904,11 +6806,10 @@ void DocText::parse()
break;
case TK_SYMBOL:
{
- char letter='\0';
- DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name,&letter);
- if (s!=DocSymbol::Unknown)
+ DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name);
+ if (s!=DocSymbol::Sym_Unknown)
{
- m_children.append(new DocSymbol(this,s,letter));
+ m_children.append(new DocSymbol(this,s));
}
else
{
@@ -6921,34 +6822,43 @@ void DocText::parse()
switch (Mappers::cmdMapper->map(g_token->name))
{
case CMD_BSLASH:
- m_children.append(new DocSymbol(this,DocSymbol::BSlash));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_BSlash));
break;
case CMD_AT:
- m_children.append(new DocSymbol(this,DocSymbol::At));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_At));
break;
case CMD_LESS:
- m_children.append(new DocSymbol(this,DocSymbol::Less));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Less));
break;
case CMD_GREATER:
- m_children.append(new DocSymbol(this,DocSymbol::Greater));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Greater));
break;
case CMD_AMP:
- m_children.append(new DocSymbol(this,DocSymbol::Amp));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Amp));
break;
case CMD_DOLLAR:
- m_children.append(new DocSymbol(this,DocSymbol::Dollar));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Dollar));
break;
case CMD_HASH:
- m_children.append(new DocSymbol(this,DocSymbol::Hash));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Hash));
break;
case CMD_DCOLON:
- m_children.append(new DocSymbol(this,DocSymbol::DoubleColon));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_DoubleColon));
break;
case CMD_PERCENT:
- m_children.append(new DocSymbol(this,DocSymbol::Percent));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Percent));
+ break;
+ case CMD_NDASH:
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
+ break;
+ case CMD_MDASH:
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
break;
case CMD_QUOTE:
- m_children.append(new DocSymbol(this,DocSymbol::Quot));
+ m_children.append(new DocSymbol(this,DocSymbol::Sym_Quot));
break;
default:
warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected command `%s' found",