mirror of
https://github.com/pantor/inja.git
synced 2026-04-24 00:39:24 +00:00
Fix: Remove circular dependencies in headers (#295)
* Remove circular dependencies in headers * Fix unit test includes and test data directory location
This commit is contained in:
committed by
GitHub
parent
17ba53cb9e
commit
384a6bef3f
@@ -7,12 +7,13 @@
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#include "json.hpp"
|
||||
#include "config.hpp"
|
||||
#include "function_storage.hpp"
|
||||
#include "inja.hpp"
|
||||
#include "parser.hpp"
|
||||
#include "renderer.hpp"
|
||||
#include "template.hpp"
|
||||
#include "throw.hpp"
|
||||
|
||||
namespace inja {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "inja.hpp"
|
||||
#include "json.hpp"
|
||||
|
||||
namespace inja {
|
||||
|
||||
|
||||
@@ -25,32 +25,8 @@ SOFTWARE.
|
||||
#ifndef INCLUDE_INJA_INJA_HPP_
|
||||
#define INCLUDE_INJA_INJA_HPP_
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace inja {
|
||||
#ifndef INJA_DATA_TYPE
|
||||
using json = nlohmann::json;
|
||||
#else
|
||||
using json = INJA_DATA_TYPE;
|
||||
#endif
|
||||
} // namespace inja
|
||||
|
||||
#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(INJA_NOEXCEPTION)
|
||||
#ifndef INJA_THROW
|
||||
#define INJA_THROW(exception) throw exception
|
||||
#endif
|
||||
#else
|
||||
#include <cstdlib>
|
||||
#ifndef INJA_THROW
|
||||
#define INJA_THROW(exception) \
|
||||
std::abort(); \
|
||||
std::ignore = exception
|
||||
#endif
|
||||
#ifndef INJA_NOEXCEPTION
|
||||
#define INJA_NOEXCEPTION
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "json.hpp"
|
||||
#include "throw.hpp"
|
||||
#include "environment.hpp"
|
||||
#include "exceptions.hpp"
|
||||
#include "parser.hpp"
|
||||
|
||||
14
include/inja/json.hpp
Normal file
14
include/inja/json.hpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef INCLUDE_INJA_JSON_HPP_
|
||||
#define INCLUDE_INJA_JSON_HPP_
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace inja {
|
||||
#ifndef INJA_DATA_TYPE
|
||||
using json = nlohmann::json;
|
||||
#else
|
||||
using json = INJA_DATA_TYPE;
|
||||
#endif
|
||||
} // namespace inja
|
||||
|
||||
#endif // INCLUDE_INJA_JSON_HPP_
|
||||
@@ -9,8 +9,8 @@
|
||||
#include <vector>
|
||||
|
||||
#include "function_storage.hpp"
|
||||
#include "inja.hpp"
|
||||
#include "utils.hpp"
|
||||
#include "json.hpp"
|
||||
|
||||
namespace inja {
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
#include "config.hpp"
|
||||
#include "exceptions.hpp"
|
||||
#include "function_storage.hpp"
|
||||
#include "inja.hpp"
|
||||
#include "lexer.hpp"
|
||||
#include "node.hpp"
|
||||
#include "template.hpp"
|
||||
#include "throw.hpp"
|
||||
#include "token.hpp"
|
||||
|
||||
namespace inja {
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#include "config.hpp"
|
||||
#include "exceptions.hpp"
|
||||
#include "function_storage.hpp"
|
||||
#include "inja.hpp"
|
||||
#include "node.hpp"
|
||||
#include "template.hpp"
|
||||
#include "throw.hpp"
|
||||
#include "utils.hpp"
|
||||
|
||||
namespace inja {
|
||||
|
||||
20
include/inja/throw.hpp
Normal file
20
include/inja/throw.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef INCLUDE_INJA_THROW_HPP_
|
||||
#define INCLUDE_INJA_THROW_HPP_
|
||||
|
||||
#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(INJA_NOEXCEPTION)
|
||||
#ifndef INJA_THROW
|
||||
#define INJA_THROW(exception) throw exception
|
||||
#endif
|
||||
#else
|
||||
#include <cstdlib>
|
||||
#ifndef INJA_THROW
|
||||
#define INJA_THROW(exception) \
|
||||
std::abort(); \
|
||||
std::ignore = exception
|
||||
#endif
|
||||
#ifndef INJA_NOEXCEPTION
|
||||
#define INJA_NOEXCEPTION
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_INJA_THROW_HPP_
|
||||
Reference in New Issue
Block a user