33 std::vector<std::pair<std::shared_ptr<IfToken>,
NodeList>> nodelistConditions;
38 auto cond = ip.parse();
39 auto nodelist = p->
parse(n, {QStringLiteral(
"elif"), QStringLiteral(
"else"),
40 QStringLiteral(
"endif")});
41 nodelistConditions.push_back({cond, nodelist});
45 while (token.content.startsWith(QLatin1String(
"elif"))) {
50 nodelist = p->
parse(n, {QStringLiteral(
"elif"), QStringLiteral(
"else"),
51 QStringLiteral(
"endif")});
52 nodelistConditions.push_back({cond, nodelist});
56 if (token.content == QLatin1String(
"else")) {
57 nodelist = p->
parse(n, QStringLiteral(
"endif"));
58 nodelistConditions.push_back({
nullptr, nodelist});
62 n->setNodelistConditions(nodelistConditions);
64 auto commandName = expr.takeAt(0);
65 if (expr.size() <= 0) {
68 QStringLiteral(
"'%1' statement requires at least one argument")
The Context class holds the context to render a Template with.