Commit Graph

7 Commits

Author SHA1 Message Date
Mark Hollomon
a5862a04dc Fix for issue #82 - Nested loops (#84)
* Fix for issue #82 - Nested loops

I made the following changes in renderer.hpp
- Removed the member LoopLevel::it - it was not being used and was
causing issues.
- Added LoopLevel::loop_type with a matching enum class to mark the loop
as looping on either a Map or an Array. This was to replace the hard to
understand test for key_name.empty().
- Modified update_loop_data to get the correct data for map type loops
when copying in outer loop control data.
- Modified update_loop_data to only copy in the outer loop data during
StartLoop, it does not need to be done at EndLoop and can be expensive
since it can copy a large part of the json tree.

All the tests pass and the test cases from the issue also now work. Both
GCC and Clang will compile and run the tests with no issue. No issue is
seen with address_sanitizer in either compiler.

* Remove forgotten debugging code.
2019-01-27 10:15:40 +01:00
Mark Hollomon
1dfd86fa6f Fix for issue #80 (#81)
* Fix for issue #80

When updating the `opening_chars`, line_statment was forgotten. So, a
change to any of the openers would cause line statements to start being
unrecognized.

I added a unit test to cover this case.

* fix indentation

* add update to single_include
2019-01-23 19:18:47 +01:00
pantor
dbcd5265fc add string_view polyfill 2019-01-21 21:34:34 +01:00
Tim
0bff74666e Change std::stringstream& to std::ostream& in render_to() (#76)
* Change std::stringstream& to std::ostream& in render_to()

Fixes #75

* Expose render_to

* Update readme with example of render_to
2019-01-10 14:39:12 +01:00
Lars Berscheid
02b8355081 update single include file 2019-01-07 16:46:25 +01:00
pantor
699c207c8c Inja v2 (#67)
* inja2

* header only

* reduce dependencies

* code cleaning

* c++17

* use stdc++

* code cleaning

* infrastructure

* header only

* add infrastructure

* fix tests

* use minimum clang 6

* code cleaning, polyfill for c++11

* fix some file tests

* fix readme

* update appveyor

* fix polyfill and ci

* fix polyfill

* fix ci?

* test msvc __cplusplus

* add doxygen

* activate all tests

* code cleaning

* add coveralls, set default to dot notation

* add html test

* add doxygen comments

* test single_include file

* change build folder in appveyor

* correct make arguments in appveyor

* fix appveyor arguments
2018-12-23 16:13:15 +01:00
pantor
595076ebec split dev files and amalgamate into a single header 2018-12-14 18:03:45 +01:00