bugfix in section render when context is array
This commit is contained in:
parent
99677a30c4
commit
4c43b33291
3 changed files with 10 additions and 8 deletions
|
@ -3,6 +3,7 @@
|
||||||
#include "state/outside_section.h"
|
#include "state/outside_section.h"
|
||||||
|
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
#include <visitor/to_json.h>
|
||||||
|
|
||||||
using namespace mstch;
|
using namespace mstch;
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,8 @@ std::string visitor::render_section::operator()(const std::string& str) const {
|
||||||
std::string visitor::render_section::operator()(const array& arr) const {
|
std::string visitor::render_section::operator()(const array& arr) const {
|
||||||
std::ostringstream out;
|
std::ostringstream out;
|
||||||
for (auto& item: arr)
|
for (auto& item: arr)
|
||||||
out << boost::apply_visitor(*this, item);
|
out << render_context(mstch::object{{".", item}}, context)
|
||||||
|
.render(section);
|
||||||
return out.str();
|
return out.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ MSTCH_TEST("Empty string", mstchtest::empty_string)
|
||||||
MSTCH_TEST("Empty template", mstchtest::empty_template)
|
MSTCH_TEST("Empty template", mstchtest::empty_template)
|
||||||
MSTCH_TEST("Error not found", mstchtest::error_not_found)
|
MSTCH_TEST("Error not found", mstchtest::error_not_found)
|
||||||
MSTCH_TEST("Falsy", mstchtest::falsy)
|
MSTCH_TEST("Falsy", mstchtest::falsy)
|
||||||
//MSTCH_TEST("Falsy array", mstchtest::falsy_array)
|
MSTCH_TEST("Falsy array", mstchtest::falsy_array)
|
||||||
MSTCH_TEST("Grandparent context", mstchtest::grandparent_context)
|
MSTCH_TEST("Grandparent context", mstchtest::grandparent_context)
|
||||||
MSTCH_TEST("Implicit iterator", mstchtest::implicit_iterator)
|
MSTCH_TEST("Implicit iterator", mstchtest::implicit_iterator)
|
||||||
MSTCH_TEST("Included tag", mstchtest::included_tag)
|
MSTCH_TEST("Included tag", mstchtest::included_tag)
|
||||||
|
@ -32,7 +32,7 @@ MSTCH_TEST("Nested dot", mstchtest::nested_dot)
|
||||||
MSTCH_TEST("Nested iterating", mstchtest::nested_iterating)
|
MSTCH_TEST("Nested iterating", mstchtest::nested_iterating)
|
||||||
MSTCH_TEST("Nesting", mstchtest::nesting)
|
MSTCH_TEST("Nesting", mstchtest::nesting)
|
||||||
MSTCH_TEST("Nesting same name", mstchtest::nesting_same_name)
|
MSTCH_TEST("Nesting same name", mstchtest::nesting_same_name)
|
||||||
//MSTCH_TEST("Null lookup array", mstchtest::null_lookup_array)
|
MSTCH_TEST("Null lookup array", mstchtest::null_lookup_array)
|
||||||
MSTCH_TEST("Null lookup object", mstchtest::null_lookup_object)
|
MSTCH_TEST("Null lookup object", mstchtest::null_lookup_object)
|
||||||
MSTCH_TEST("Null view", mstchtest::null_view)
|
MSTCH_TEST("Null view", mstchtest::null_view)
|
||||||
MSTCH_TEST("Recursion with same names", mstchtest::recursion_with_same_names)
|
MSTCH_TEST("Recursion with same names", mstchtest::recursion_with_same_names)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue