- include
- crow
- mustache.h
diff --git a/master/reference/mustache_8h_source.html b/master/reference/mustache_8h_source.html
index 56fb03652..11e901e1d 100644
--- a/master/reference/mustache_8h_source.html
+++ b/master/reference/mustache_8h_source.html
@@ -665,355 +665,362 @@
542 while (body_[endIdx - 1] ==
' ')
- 545 auto& matched = actions_[blockPositions.back()];
- 546 if (body_.compare(idx, endIdx - idx,
- 547 body_, matched.start, matched.end - matched.start) != 0)
-
- 549 throw invalid_template_exception(
- 550 std::string(
"not matched {{")
-
-
- 553 + body_.substr(matched.start, matched.end - matched.start) +
", "
- 554 + body_.substr(idx, endIdx - idx)
-
-
- 557 matched.pos =
static_cast<int>(actions_.size());
- 558 matched.has_end_match =
true;
-
- 560 actions_.emplace_back(tag_char, ActionType::CloseBlock, idx, endIdx, blockPositions.back());
- 561 blockPositions.pop_back();
-
-
-
- 565 while (body_[idx] ==
' ')
-
- 567 while (body_[endIdx - 1] ==
' ')
-
- 569 blockPositions.emplace_back(
static_cast<int>(actions_.size()));
- 570 actions_.emplace_back(tag_char, ActionType::ElseBlock, idx, endIdx);
-
-
-
- 574 actions_.emplace_back(tag_char, ActionType::Ignore, idx + 1, endIdx);
-
-
-
- 578 while (body_[idx] ==
' ')
-
- 580 while (body_[endIdx - 1] ==
' ')
-
- 582 actions_.emplace_back(tag_char, ActionType::Partial, idx, endIdx);
-
-
- 585 if (tag_open !=
"{{" || tag_close !=
"}}")
- 586 throw invalid_template_exception(
"cannot use triple mustache when delimiter changed");
-
-
- 589 if (body_[endIdx + 2] !=
'}')
-
- 591 throw invalid_template_exception(
"{{{: }}} not matched");
-
- 593 while (body_[idx] ==
' ')
-
- 595 while (body_[endIdx - 1] ==
' ')
-
- 597 actions_.emplace_back(tag_char, ActionType::UnescapeTag, idx, endIdx);
-
-
-
-
- 602 while (body_[idx] ==
' ')
-
- 604 while (body_[endIdx - 1] ==
' ')
-
- 606 actions_.emplace_back(tag_char, ActionType::UnescapeTag, idx, endIdx);
-
-
-
-
- 611 actions_.emplace_back(tag_char, ActionType::Ignore, idx, endIdx);
-
- 613 if (body_[endIdx] !=
'=')
- 614 throw invalid_template_exception(
"{{=: not matching = tag: " + body_.substr(idx, endIdx - idx));
-
- 616 while (body_[idx] ==
' ')
-
- 618 while (body_[endIdx] ==
' ')
-
-
-
- 622 bool succeeded =
false;
- 623 for (
size_t i = idx; i < endIdx; i++)
-
-
-
- 627 tag_open = body_.substr(idx, i - idx);
- 628 while (body_[i] ==
' ')
-
- 630 tag_close = body_.substr(i, endIdx - i);
- 631 if (tag_open.empty())
- 632 throw invalid_template_exception(
"{{=: empty open tag");
- 633 if (tag_close.empty())
- 634 throw invalid_template_exception(
"{{=: empty close tag");
-
- 636 if (tag_close.find(
" ") != tag_close.npos)
- 637 throw invalid_template_exception(
"{{=: invalid open/close tag: " + tag_open +
" " + tag_close);
-
-
-
-
-
- 643 throw invalid_template_exception(
"{{=: cannot find space between new open/close tags");
-
-
-
-
- 648 while (body_[idx] ==
' ')
-
- 650 while (body_[endIdx - 1] ==
' ')
-
- 652 actions_.emplace_back(tag_char, ActionType::Tag, idx, endIdx);
-
-
-
-
-
- 658 for (
int i = 0; i < static_cast<int>(actions_.size()); i++)
-
- 660 if (actions_[i].missing_end_pair())
-
- 662 throw invalid_template_exception(
- 663 std::string(
"open tag has no matching end tag {{")
- 664 + actions_[i].tag_char
-
- 666 + body_.substr(actions_[i].start, actions_[i].end - actions_[i].start)
-
-
-
-
-
- 672 for (
int i =
static_cast<int>(actions_.size()) - 2; i >= 0; i--)
-
- 674 if (actions_[i].t == ActionType::Tag || actions_[i].t == ActionType::UnescapeTag)
-
- 676 auto& fragment_before = fragments_[i];
- 677 auto& fragment_after = fragments_[i + 1];
- 678 bool is_last_action = i ==
static_cast<int>(actions_.size()) - 2;
- 679 bool all_space_before =
true;
-
- 681 for (j = fragment_before.second - 1; j >= fragment_before.first; j--)
-
-
-
- 685 all_space_before =
false;
-
-
-
- 689 if (all_space_before && i > 0)
-
- 691 if (!all_space_before && body_[j] !=
'\n')
-
- 693 bool all_space_after =
true;
- 694 for (k = fragment_after.first; k < static_cast<int>(body_.size()) && k < fragment_after.second; k++)
-
-
-
- 698 all_space_after =
false;
-
-
-
- 702 if (all_space_after && !is_last_action)
-
- 704 if (!all_space_after &&
-
-
-
- 708 k + 1 <
static_cast<int>(body_.size()) &&
- 709 body_[k + 1] ==
'\n')))
+ 545 if (blockPositions.empty())
+
+ 547 throw invalid_template_exception(
+ 548 std::string(
"unexpected closing tag: ")
+ 549 + body_.substr(idx, endIdx - idx)
+
+
+ 552 auto& matched = actions_[blockPositions.back()];
+ 553 if (body_.compare(idx, endIdx - idx,
+ 554 body_, matched.start, matched.end - matched.start) != 0)
+
+ 556 throw invalid_template_exception(
+ 557 std::string(
"not matched {{")
+
+
+ 560 + body_.substr(matched.start, matched.end - matched.start) +
", "
+ 561 + body_.substr(idx, endIdx - idx)
+
+
+ 564 matched.pos =
static_cast<int>(actions_.size());
+ 565 matched.has_end_match =
true;
+
+ 567 actions_.emplace_back(tag_char, ActionType::CloseBlock, idx, endIdx, blockPositions.back());
+ 568 blockPositions.pop_back();
+
+
+
+ 572 while (body_[idx] ==
' ')
+
+ 574 while (body_[endIdx - 1] ==
' ')
+
+ 576 blockPositions.emplace_back(
static_cast<int>(actions_.size()));
+ 577 actions_.emplace_back(tag_char, ActionType::ElseBlock, idx, endIdx);
+
+
+
+ 581 actions_.emplace_back(tag_char, ActionType::Ignore, idx + 1, endIdx);
+
+
+
+ 585 while (body_[idx] ==
' ')
+
+ 587 while (body_[endIdx - 1] ==
' ')
+
+ 589 actions_.emplace_back(tag_char, ActionType::Partial, idx, endIdx);
+
+
+ 592 if (tag_open !=
"{{" || tag_close !=
"}}")
+ 593 throw invalid_template_exception(
"cannot use triple mustache when delimiter changed");
+
+
+ 596 if (body_[endIdx + 2] !=
'}')
+
+ 598 throw invalid_template_exception(
"{{{: }}} not matched");
+
+ 600 while (body_[idx] ==
' ')
+
+ 602 while (body_[endIdx - 1] ==
' ')
+
+ 604 actions_.emplace_back(tag_char, ActionType::UnescapeTag, idx, endIdx);
+
+
+
+
+ 609 while (body_[idx] ==
' ')
+
+ 611 while (body_[endIdx - 1] ==
' ')
+
+ 613 actions_.emplace_back(tag_char, ActionType::UnescapeTag, idx, endIdx);
+
+
+
+
+ 618 actions_.emplace_back(tag_char, ActionType::Ignore, idx, endIdx);
+
+ 620 if (body_[endIdx] !=
'=')
+ 621 throw invalid_template_exception(
"{{=: not matching = tag: " + body_.substr(idx, endIdx - idx));
+
+ 623 while (body_[idx] ==
' ')
+
+ 625 while (body_[endIdx] ==
' ')
+
+
+
+ 629 bool succeeded =
false;
+ 630 for (
size_t i = idx; i < endIdx; i++)
+
+
+
+ 634 tag_open = body_.substr(idx, i - idx);
+ 635 while (body_[i] ==
' ')
+
+ 637 tag_close = body_.substr(i, endIdx - i);
+ 638 if (tag_open.empty())
+ 639 throw invalid_template_exception(
"{{=: empty open tag");
+ 640 if (tag_close.empty())
+ 641 throw invalid_template_exception(
"{{=: empty close tag");
+
+ 643 if (tag_close.find(
" ") != tag_close.npos)
+ 644 throw invalid_template_exception(
"{{=: invalid open/close tag: " + tag_open +
" " + tag_close);
+
+
+
+
+
+ 650 throw invalid_template_exception(
"{{=: cannot find space between new open/close tags");
+
+
+
+
+ 655 while (body_[idx] ==
' ')
+
+ 657 while (body_[endIdx - 1] ==
' ')
+
+ 659 actions_.emplace_back(tag_char, ActionType::Tag, idx, endIdx);
+
+
+
+
+
+ 665 for (
int i = 0; i < static_cast<int>(actions_.size()); i++)
+
+ 667 if (actions_[i].missing_end_pair())
+
+ 669 throw invalid_template_exception(
+ 670 std::string(
"open tag has no matching end tag {{")
+ 671 + actions_[i].tag_char
+
+ 673 + body_.substr(actions_[i].start, actions_[i].end - actions_[i].start)
+
+
+
+
+
+ 679 for (
int i =
static_cast<int>(actions_.size()) - 2; i >= 0; i--)
+
+ 681 if (actions_[i].t == ActionType::Tag || actions_[i].t == ActionType::UnescapeTag)
+
+ 683 auto& fragment_before = fragments_[i];
+ 684 auto& fragment_after = fragments_[i + 1];
+ 685 bool is_last_action = i ==
static_cast<int>(actions_.size()) - 2;
+ 686 bool all_space_before =
true;
+
+ 688 for (j = fragment_before.second - 1; j >= fragment_before.first; j--)
+
+
+
+ 692 all_space_before =
false;
+
+
+
+ 696 if (all_space_before && i > 0)
+
+ 698 if (!all_space_before && body_[j] !=
'\n')
+
+ 700 bool all_space_after =
true;
+ 701 for (k = fragment_after.first; k < static_cast<int>(body_.size()) && k < fragment_after.second; k++)
+
+
+
+ 705 all_space_after =
false;
+
+
+
+ 709 if (all_space_after && !is_last_action)
- 711 if (actions_[i].t == ActionType::Partial)
-
- 713 actions_[i].pos = fragment_before.second - j - 1;
-
- 715 fragment_before.second = j + 1;
- 716 if (!all_space_after)
-
- 718 if (body_[k] ==
'\n')
-
-
-
- 722 fragment_after.first = k;
-
-
-
-
- 727 std::vector<std::pair<int, int>> fragments_;
- 728 std::vector<Action> actions_;
-
-
+ 711 if (!all_space_after &&
+
+
+
+ 715 k + 1 <
static_cast<int>(body_.size()) &&
+ 716 body_[k + 1] ==
'\n')))
+
+ 718 if (actions_[i].t == ActionType::Partial)
+
+ 720 actions_[i].pos = fragment_before.second - j - 1;
+
+ 722 fragment_before.second = j + 1;
+ 723 if (!all_space_after)
+
+ 725 if (body_[k] ==
'\n')
+
+
+
+ 729 fragment_after.first = k;
+
+
+
+
+ 734 std::vector<std::pair<int, int>> fragments_;
+ 735 std::vector<Action> actions_;
+
+