summaryrefslogtreecommitdiffstats
path: root/src/template.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-12-14 15:39:29 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-12-25 12:43:31 (GMT)
commitfe818bf8e3a154788a4a180068cfdfbbadd66ff6 (patch)
treec08545cd15e627b36eef1e0d0a7eb4fa0bb76437 /src/template.cpp
parent3ebc431569aa6566389f3f3fc00aae7b8a90e58b (diff)
downloadDoxygen-fe818bf8e3a154788a4a180068cfdfbbadd66ff6.zip
Doxygen-fe818bf8e3a154788a4a180068cfdfbbadd66ff6.tar.gz
Doxygen-fe818bf8e3a154788a4a180068cfdfbbadd66ff6.tar.bz2
Added graphical hierarchy support to template engine
Diffstat (limited to 'src/template.cpp')
-rw-r--r--src/template.cpp29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/template.cpp b/src/template.cpp
index 100de16..9fa03aa 100644
--- a/src/template.cpp
+++ b/src/template.cpp
@@ -1976,10 +1976,21 @@ class ExpressionParser
ExprAst *parseLiteral()
{
TRACE(("{parseLiteral(%s)\n",m_curToken.id.data()));
- ExprAst *lit = new ExprAstLiteral(m_curToken.id);
+ ExprAst *expr = new ExprAstLiteral(m_curToken.id);
getNextToken();
+ if (expr)
+ {
+ while (m_curToken.type==ExprToken::Operator &&
+ m_curToken.op==Operator::Filter)
+ {
+ getNextToken();
+ ExprAstFilter *filter = parseFilter();
+ if (!filter) break;
+ expr = new ExprAstFilterAppl(expr,filter);
+ }
+ }
TRACE(("}parseLiteral()\n"));
- return lit;
+ return expr;
}
ExprAst *parseIdentifierOptionalArgs()
@@ -3550,6 +3561,7 @@ class TemplateNodeCreate : public TemplateNodeCreator<TemplateNodeCreate>
{
outputFile.prepend(ci->outputDirectory()+"/");
}
+ //printf("NoteCreate(%s)\n",outputFile.data());
QFile f(outputFile);
if (f.open(IO_WriteOnly))
{
@@ -3622,9 +3634,11 @@ class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree>
{
//printf("TemplateNodeTree::renderChildren(%d)\n",ctx->list->count());
// render all children of node to a string and return it
+ TemplateContext *c = ctx->templateCtx;
+ TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
+ if (ci==0) return QCString(); // should not happen
QGString result;
FTextStream ss(&result);
- TemplateContext *c = ctx->templateCtx;
c->push();
TemplateVariant node;
TemplateListIntf::ConstIterator *it = ctx->list->createIterator();
@@ -3642,14 +3656,21 @@ class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree>
if (list && list->count()>0) // non-empty list
{
TreeContext childCtx(this,list,ctx->templateCtx);
-// TemplateVariant children(&childCtx,renderChildrenStub);
TemplateVariant children(TemplateVariant::Delegate::fromFunction(&childCtx,renderChildrenStub));
children.setRaw(TRUE);
c->set("children",children);
m_treeNodes.render(ss,c);
hasChildren=TRUE;
}
+ else if (list==0)
+ {
+ ci->warn(m_templateName,m_line,"recursetree: children attribute has type '%s' instead of list\n",v.typeAsString().data());
+ }
}
+ //else
+ //{
+ // ci->warn(m_templateName,m_line,"recursetree: children attribute is not valid");
+ //}
}
if (!hasChildren)
{