Merge branch 'pboettch:main' into fix-multiple-of-float
This commit is contained in:
commit
7d84d546f9
@ -80,26 +80,28 @@ endif ()
|
||||
]==============================================================================================]
|
||||
|
||||
set(fetch_packages "")
|
||||
# Fetch/Find nlohmann_json
|
||||
# TODO: Remove when bumping cmake >= 3.24
|
||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
|
||||
FetchContent_Declare(nlohmann_json
|
||||
GIT_REPOSITORY https://github.com/nlohmann/json
|
||||
GIT_TAG ${JSON_FETCH_VERSION}
|
||||
FIND_PACKAGE_ARGS
|
||||
)
|
||||
list(APPEND fetch_packages nlohmann_json)
|
||||
else ()
|
||||
# Try to get system installed version
|
||||
find_package(nlohmann_json QUIET)
|
||||
if (NOT nlohmann_json_FOUND)
|
||||
# If failed fetch the desired version
|
||||
FetchContent_Declare(nlohmann_json
|
||||
GIT_REPOSITORY https://github.com/nlohmann/json
|
||||
GIT_TAG ${JSON_FETCH_VERSION}
|
||||
)
|
||||
list(APPEND fetch_packages nlohmann_json)
|
||||
endif ()
|
||||
if (NOT TARGET nlohmann_json)
|
||||
# Fetch/Find nlohmann_json
|
||||
# TODO: Remove when bumping cmake >= 3.24
|
||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
|
||||
FetchContent_Declare(nlohmann_json
|
||||
GIT_REPOSITORY https://github.com/nlohmann/json
|
||||
GIT_TAG ${JSON_FETCH_VERSION}
|
||||
FIND_PACKAGE_ARGS
|
||||
)
|
||||
list(APPEND fetch_packages nlohmann_json)
|
||||
else ()
|
||||
# Try to get system installed version
|
||||
find_package(nlohmann_json QUIET)
|
||||
if (NOT nlohmann_json_FOUND)
|
||||
# If failed fetch the desired version
|
||||
FetchContent_Declare(nlohmann_json
|
||||
GIT_REPOSITORY https://github.com/nlohmann/json
|
||||
GIT_TAG ${JSON_FETCH_VERSION}
|
||||
)
|
||||
list(APPEND fetch_packages nlohmann_json)
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Handle configure flags
|
||||
|
||||
@ -74,7 +74,7 @@ types, depending on if the schema type is "integer" or "number". Bignum
|
||||
This library is based on Niels Lohmann's JSON-library and thus has
|
||||
a build-dependency to it.
|
||||
|
||||
Currently at least version **3.6.0** of NLohmann's JSON library
|
||||
Currently at least version **3.8.0** of NLohmann's JSON library
|
||||
is required.
|
||||
|
||||
Various methods using CMake can be used to build this project.
|
||||
|
||||
@ -28,10 +28,13 @@ public:
|
||||
json_patch &replace(const json::json_pointer &, json value);
|
||||
json_patch &remove(const json::json_pointer &);
|
||||
|
||||
json &get_json() { return j_; }
|
||||
const json &get_json() const { return j_; }
|
||||
|
||||
operator json() const { return j_; }
|
||||
|
||||
private:
|
||||
json j_;
|
||||
json j_ = nlohmann::json::array();
|
||||
|
||||
static void validateJsonPatch(json const &patch);
|
||||
};
|
||||
|
||||
@ -436,12 +436,12 @@ class logical_combination : public schema
|
||||
|
||||
for (auto &s : subschemata_) {
|
||||
first_error_handler esub;
|
||||
json_patch old_patch(patch);
|
||||
auto oldPatchSize = patch.get_json().size();
|
||||
s->validate(ptr, instance, patch, esub);
|
||||
if (!esub)
|
||||
count++;
|
||||
else
|
||||
patch = old_patch;
|
||||
patch.get_json().get_ref<nlohmann::json::array_t &>().resize(oldPatchSize);
|
||||
|
||||
if (is_validate_complete(instance, ptr, e, esub, count))
|
||||
return;
|
||||
|
||||
@ -669,10 +669,6 @@ static const short _address_eof_trans[] = {
|
||||
1278, 1279, 1280, 1281, 1282, 1283, 0};
|
||||
|
||||
static const int address_start = 1;
|
||||
static const int address_first_final = 196;
|
||||
static const int address_error = 0;
|
||||
|
||||
static const int address_en_main = 1;
|
||||
|
||||
bool is_address(const char *p, const char *pe)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user