diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 505bbdf..125cdea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,6 +108,12 @@ jobs: ${{ matrix.platform.options }} - run: cmake --build ./build --config Release --target clang_format_test - run: cmake --build ./build --config Release --parallel 4 + - run: > + cmake --install ./build --prefix ./build/dist --config Release --verbose + --component sourcemeta_noa + - run: > + cmake --install ./build --prefix ./build/dist --config Release --verbose + --component sourcemeta_noa_dev - run: > cmake --install ./build --prefix ./build/dist --config Release --verbose --component sourcemeta_jsontoolkit diff --git a/CMakeLists.txt b/CMakeLists.txt index ac8608d..91320a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,6 @@ project(alterschema VERSION 0.0.1 LANGUAGES CXX DESCRIPTION "Perform advanced transformations on JSON Schemas" HOMEPAGE_URL "https://alterschema.sourcemeta.com") list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") -include(vendor/noa/cmake/noa.cmake) # Options option(ALTERSCHEMA_ENGINE "Build the AlterSchema Engine library" ON) @@ -14,6 +13,8 @@ option(ALTERSCHEMA_INSTALL "Install the AlterSchema library" ON) option(ALTERSCHEMA_ADDRESS_SANITIZER "Build AlterSchema with an address sanitizer" OFF) option(ALTERSCHEMA_UNDEFINED_SANITIZER "Build AlterSchema with an undefined behavior sanitizer" OFF) +find_package(Noa REQUIRED) + if(ALTERSCHEMA_INSTALL) include(GNUInstallDirs) include(CMakePackageConfigHelpers) @@ -60,7 +61,6 @@ endif() # Testing if(ALTERSCHEMA_TESTS) - find_package(GoogleTest REQUIRED) enable_testing() if(ALTERSCHEMA_ENGINE) diff --git a/DEPENDENCIES b/DEPENDENCIES index 9cabd38..7f7b19d 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -1,4 +1,4 @@ vendorpull https://github.com/sourcemeta/vendorpull dea311b5bfb53b6926a4140267959ae334d3ecf4 -noa https://github.com/sourcemeta/noa caad2e1ceedf9fd1a18686a6a6d1e2b9757ead75 -jsontoolkit https://github.com/sourcemeta/jsontoolkit 93a921d0f1e99bfdfe14bfd4d2acf5981294080b +noa https://github.com/sourcemeta/noa a8d36453236abc365f08a76a486f92c84f976fd9 +jsontoolkit https://github.com/sourcemeta/jsontoolkit 60a3862ad0d9642c97685f94aeaed96ab3509690 googletest https://github.com/google/googletest a7f443b80b105f940225332ed3c31f2790092f47 diff --git a/Makefile b/Makefile index d776cfe..9c17ce9 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,10 @@ configure: .always compile: .always $(CMAKE) --build ./build --config $(PRESET) --target clang_format $(CMAKE) --build ./build --config $(PRESET) --parallel 4 + $(CMAKE) --install ./build --prefix ./build/dist --config $(PRESET) --verbose \ + --component sourcemeta_noa + $(CMAKE) --install ./build --prefix ./build/dist --config $(PRESET) --verbose \ + --component sourcemeta_noa_dev $(CMAKE) --install ./build --prefix ./build/dist --config $(PRESET) --verbose \ --component sourcemeta_jsontoolkit $(CMAKE) --install ./build --prefix ./build/dist --config $(PRESET) --verbose \ diff --git a/cmake/FindNoa.cmake b/cmake/FindNoa.cmake new file mode 100644 index 0000000..9706e79 --- /dev/null +++ b/cmake/FindNoa.cmake @@ -0,0 +1,12 @@ +if(NOT Noa_FOUND) + if(ALTERSCHEMA_INSTALL) + set(NOA_INSTALL ON CACHE BOOL "enable Noa installation") + else() + set(NOA_INSTALL OFF CACHE BOOL "disable Noa installation") + endif() + + set(NOA_GOOGLETEST ${ALTERSCHEMA_TESTS} CACHE BOOL "GoogleTest") + set(NOA_GOOGLEBENCHMARK OFF CACHE BOOL "GoogleBenchmark") + add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/noa") + set(Noa_FOUND ON) +endif() diff --git a/test/engine/CMakeLists.txt b/test/engine/CMakeLists.txt index 8597e5e..1a063e7 100644 --- a/test/engine/CMakeLists.txt +++ b/test/engine/CMakeLists.txt @@ -1,14 +1,8 @@ -add_executable(sourcemeta_alterschema_engine_unit - transformer_test.cc rule_test.cc bundle_test.cc rules.h) -noa_add_default_options(PRIVATE sourcemeta_alterschema_engine_unit) -target_link_libraries(sourcemeta_alterschema_engine_unit - PRIVATE GTest::gtest) -target_link_libraries(sourcemeta_alterschema_engine_unit - PRIVATE GTest::gtest_main) +noa_googletest(NAMESPACE sourcemeta PROJECT alterschema NAME engine + FOLDER "AlterSchema/Engine" + SOURCES transformer_test.cc rule_test.cc bundle_test.cc rules.h) + target_link_libraries(sourcemeta_alterschema_engine_unit PRIVATE sourcemeta::jsontoolkit::json) target_link_libraries(sourcemeta_alterschema_engine_unit PRIVATE sourcemeta::alterschema::engine) -add_test(NAME Engine COMMAND sourcemeta_alterschema_engine_unit --gtest_brief=1) -set_target_properties(sourcemeta_alterschema_engine_unit - PROPERTIES FOLDER "AlterSchema/Engine") diff --git a/test/linter/CMakeLists.txt b/test/linter/CMakeLists.txt index 107a38f..d4e5a4f 100644 --- a/test/linter/CMakeLists.txt +++ b/test/linter/CMakeLists.txt @@ -1,26 +1,20 @@ -add_executable(sourcemeta_alterschema_linter_unit - 2020_12_test.cc - 2019_09_test.cc - draft7_test.cc - draft6_test.cc - draft4_test.cc - draft3_test.cc - draft2_test.cc - draft1_test.cc - draft0_test.cc - utils.h) +noa_googletest(NAMESPACE sourcemeta PROJECT alterschema NAME linter + FOLDER "AlterSchema/Linter" + SOURCES + 2020_12_test.cc + 2019_09_test.cc + draft7_test.cc + draft6_test.cc + draft4_test.cc + draft3_test.cc + draft2_test.cc + draft1_test.cc + draft0_test.cc + utils.h) -noa_add_default_options(PRIVATE sourcemeta_alterschema_linter_unit) -target_link_libraries(sourcemeta_alterschema_linter_unit - PRIVATE GTest::gtest) -target_link_libraries(sourcemeta_alterschema_linter_unit - PRIVATE GTest::gtest_main) target_link_libraries(sourcemeta_alterschema_linter_unit PRIVATE sourcemeta::jsontoolkit::json) target_link_libraries(sourcemeta_alterschema_linter_unit PRIVATE sourcemeta::alterschema::engine) target_link_libraries(sourcemeta_alterschema_linter_unit PRIVATE sourcemeta::alterschema::linter) -add_test(NAME Linter COMMAND sourcemeta_alterschema_linter_unit --gtest_brief=1) -set_target_properties(sourcemeta_alterschema_linter_unit - PROPERTIES FOLDER "AlterSchema/Linter") diff --git a/vendor/googletest.mask b/vendor/googletest.mask deleted file mode 100644 index 022c06b..0000000 --- a/vendor/googletest.mask +++ /dev/null @@ -1,17 +0,0 @@ -googletest/test -googletest/docs -googletest/samples -googletest/README.md -googlemock -docs -ci -.clang-format -BUILD.bazel -CONTRIBUTING.md -CONTRIBUTORS -googletest_deps.bzl -README.md -WORKSPACE -MODULE.bazel -WORKSPACE.bzlmod -fake_fuchsia_sdk.bzl diff --git a/vendor/jsontoolkit/CMakeLists.txt b/vendor/jsontoolkit/CMakeLists.txt index 9c94c94..7858527 100644 --- a/vendor/jsontoolkit/CMakeLists.txt +++ b/vendor/jsontoolkit/CMakeLists.txt @@ -3,12 +3,10 @@ project(jsontoolkit VERSION 2.0.0 LANGUAGES C CXX DESCRIPTION "The swiss-army knife for JSON programming in C++" HOMEPAGE_URL "https://jsontoolkit.sourcemeta.com") list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") -include(vendor/noa/cmake/noa.cmake) # Options option(JSONTOOLKIT_URI "Build the JSON Toolkit URI library" ON) option(JSONTOOLKIT_JSON "Build the JSON Toolkit JSON library" ON) -option(JSONTOOLKIT_REGEX "Build the JSON Toolkit Regex library" ON) option(JSONTOOLKIT_JSONSCHEMA "Build the JSON Toolkit JSON Schema library" ON) option(JSONTOOLKIT_JSONPOINTER "Build the JSON Toolkit JSON Pointer library" ON) option(JSONTOOLKIT_JSONL "Build the JSON Toolkit JSONL library" ON) @@ -20,6 +18,8 @@ option(JSONTOOLKIT_INSTALL "Install the JSON Toolkit library" ON) option(JSONTOOLKIT_ADDRESS_SANITIZER "Build JSON Toolkit with an address sanitizer" OFF) option(JSONTOOLKIT_UNDEFINED_SANITIZER "Build JSON Toolkit with an undefined behavior sanitizer" OFF) +find_package(Noa REQUIRED) + if(JSONTOOLKIT_INSTALL) include(GNUInstallDirs) include(CMakePackageConfigHelpers) @@ -46,11 +46,6 @@ if(JSONTOOLKIT_JSON) add_subdirectory(src/json) endif() -if(JSONTOOLKIT_JSON AND JSONTOOLKIT_REGEX) - find_package(BoostRegex REQUIRED) - add_subdirectory(src/regex) -endif() - if(JSONTOOLKIT_JSON AND JSONTOOLKIT_JSONPOINTER) add_subdirectory(src/jsonpointer) endif() @@ -82,7 +77,6 @@ endif() if(PROJECT_IS_TOP_LEVEL) noa_target_clang_format(SOURCES - bindings/*.cc src/*.h src/*.cc benchmark/*.h benchmark/*.cc test/*.h test/*.cc) @@ -92,7 +86,6 @@ endif() # Testing if(JSONTOOLKIT_TESTS) - find_package(GoogleTest REQUIRED) enable_testing() if(JSONTOOLKIT_URI) @@ -103,10 +96,6 @@ if(JSONTOOLKIT_TESTS) add_subdirectory(test/json) endif() - if(JSONTOOLKIT_JSON AND JSONTOOLKIT_REGEX) - add_subdirectory(test/regex) - endif() - if(JSONTOOLKIT_JSON AND JSONTOOLKIT_JSONPOINTER) add_subdirectory(test/jsonpointer) endif() @@ -133,7 +122,6 @@ if(JSONTOOLKIT_TESTS) endif() if(JSONTOOLKIT_BENCHMARK) - find_package(GoogleBenchmark REQUIRED) add_subdirectory(benchmark) endif() endif() diff --git a/vendor/jsontoolkit/cmake/FindNoa.cmake b/vendor/jsontoolkit/cmake/FindNoa.cmake new file mode 100644 index 0000000..8e1fc3b --- /dev/null +++ b/vendor/jsontoolkit/cmake/FindNoa.cmake @@ -0,0 +1,12 @@ +if(NOT Noa_FOUND) + if(JSONTOOLKIT_INSTALL) + set(NOA_INSTALL ON CACHE BOOL "enable Noa installation") + else() + set(NOA_INSTALL OFF CACHE BOOL "disable Noa installation") + endif() + + set(NOA_GOOGLETEST ${JSONTOOLKIT_TESTS} CACHE BOOL "GoogleTest") + set(NOA_GOOGLEBENCHMARK ${JSONTOOLKIT_BENCHMARK} CACHE BOOL "GoogleBenchmark") + add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/noa") + set(Noa_FOUND ON) +endif() diff --git a/vendor/jsontoolkit/config.cmake.in b/vendor/jsontoolkit/config.cmake.in index ade27e9..3bc5bc2 100644 --- a/vendor/jsontoolkit/config.cmake.in +++ b/vendor/jsontoolkit/config.cmake.in @@ -6,7 +6,6 @@ list(APPEND JSONTOOLKIT_COMPONENTS ${jsontoolkit_FIND_COMPONENTS}) if(NOT JSONTOOLKIT_COMPONENTS) list(APPEND JSONTOOLKIT_COMPONENTS uri) list(APPEND JSONTOOLKIT_COMPONENTS json) - list(APPEND JSONTOOLKIT_COMPONENTS regex) list(APPEND JSONTOOLKIT_COMPONENTS jsonl) list(APPEND JSONTOOLKIT_COMPONENTS jsonpointer) list(APPEND JSONTOOLKIT_COMPONENTS jsonschema) @@ -20,11 +19,8 @@ foreach(component ${JSONTOOLKIT_COMPONENTS}) find_dependency(uriparser) include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_uri.cmake") elseif(component STREQUAL "json") + find_dependency(noa) include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_json.cmake") - elseif(component STREQUAL "regex") - include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_json.cmake") - find_dependency(BoostRegex) - include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_regex.cmake") elseif(component STREQUAL "jsonl") include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_json.cmake") include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_jsonl.cmake") diff --git a/vendor/jsontoolkit/src/json/CMakeLists.txt b/vendor/jsontoolkit/src/json/CMakeLists.txt index 37fbb4d..bffa672 100644 --- a/vendor/jsontoolkit/src/json/CMakeLists.txt +++ b/vendor/jsontoolkit/src/json/CMakeLists.txt @@ -1,8 +1,11 @@ noa_library(NAMESPACE sourcemeta PROJECT jsontoolkit NAME json FOLDER "JSON Toolkit/JSON" - PRIVATE_HEADERS array.h error.h object.h value.h hash.h flat_map.h + PRIVATE_HEADERS array.h error.h object.h value.h hash.h SOURCES grammar.h parser.h stringify.h json.cc json_value.cc) if(JSONTOOLKIT_INSTALL) noa_library_install(NAMESPACE sourcemeta PROJECT jsontoolkit NAME json) endif() + +target_link_libraries(sourcemeta_jsontoolkit_json + PUBLIC sourcemeta::noa::flat_map) diff --git a/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_hash.h b/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_hash.h index abfa638..a8d9afe 100644 --- a/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_hash.h +++ b/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_hash.h @@ -13,30 +13,29 @@ template struct FastHash { return value.fast_hash(); } - struct property_hash_type { + inline auto is_perfect(const hash_type) const noexcept -> bool { + return false; + } +}; + +/// @ingroup json +template struct KeyHash { + struct hash_type { using type = std::uint64_t; type a{0}; type b{0}; type c{0}; type d{0}; - inline auto operator==(const property_hash_type &other) const noexcept - -> bool { + inline auto operator==(const hash_type &other) const noexcept -> bool { return this->a == other.a && this->b == other.b && this->c == other.c && this->d == other.d; } - - inline auto is_perfect() const noexcept -> bool { - // If there is anything written past the first byte, - // then it is a perfect hash - return this->a > 255; - } }; - inline auto operator()(const typename T::String &value) const noexcept - -> property_hash_type { + inline auto operator()(const T &value) const noexcept -> hash_type { const auto size{value.size()}; - property_hash_type result; + hash_type result; if (size == 0) { return result; } else if (size <= 31) { @@ -47,13 +46,18 @@ template struct FastHash { // This case is specifically designed to be constant with regards to // string length, and to exploit the fact that most JSON objects don't // have a lot of entries, so hash collision is not as common - return {(size + - static_cast(value.front()) + - static_cast(value.back())) % + return {(size + static_cast(value.front()) + + static_cast(value.back())) % // Make sure the property hash can never exceed 8 bits 256}; } } + + inline auto is_perfect(const hash_type &hash) const noexcept -> bool { + // If there is anything written past the first byte, + // then it is a perfect hash + return hash.a > 255; + } }; } // namespace sourcemeta::jsontoolkit diff --git a/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_object.h b/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_object.h index a5d7396..d5082b9 100644 --- a/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_object.h +++ b/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_object.h @@ -4,7 +4,7 @@ #include // std::equal_to, std::less #include // std::initializer_list -#include +#include namespace sourcemeta::jsontoolkit { @@ -12,7 +12,7 @@ namespace sourcemeta::jsontoolkit { template class JSONObject { public: // Constructors - using Container = FlatMap; + using Container = sourcemeta::noa::FlatMap; JSONObject() : data{} {} JSONObject(std::initializer_list values) diff --git a/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_value.h b/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_value.h index b883f7b..abe4b39 100644 --- a/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_value.h +++ b/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_value.h @@ -43,7 +43,7 @@ class SOURCEMETA_JSONTOOLKIT_JSON_EXPORT JSON { /// The array type used by the JSON document. using Array = JSONArray; /// The object type used by the JSON document. - using Object = JSONObject>; + using Object = JSONObject>; /* * Constructors diff --git a/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer.h b/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer.h index 8236eb0..6758038 100644 --- a/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer.h +++ b/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer.h @@ -31,10 +31,11 @@ namespace sourcemeta::jsontoolkit { /// @ingroup jsonpointer -using Pointer = GenericPointer; +using Pointer = GenericPointer>; /// @ingroup jsonpointer -using WeakPointer = GenericPointer>; +using WeakPointer = GenericPointer, + KeyHash>; /// @ingroup jsonpointer /// A global constant instance of the empty JSON Pointer. diff --git a/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer_pointer.h b/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer_pointer.h index 9075913..c82840e 100644 --- a/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer_pointer.h +++ b/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer_pointer.h @@ -17,7 +17,7 @@ namespace sourcemeta::jsontoolkit { /// @ingroup jsonpointer -template class GenericPointer { +template class GenericPointer { public: using Token = GenericToken; using Value = typename Token::Value; @@ -206,7 +206,7 @@ template class GenericPointer { /// assert(pointer.at(1).to_property() == "bar"); /// assert(pointer.at(2).to_property() == "baz"); /// ``` - auto push_back(const GenericPointer &other) -> void { + auto push_back(const GenericPointer &other) -> void { if (other.empty()) { return; } else if (other.size() == 1) { @@ -239,7 +239,7 @@ template class GenericPointer { /// assert(pointer.at(1).to_property() == "bar"); /// assert(pointer.at(2).to_property() == "baz"); /// ``` - auto push_back(GenericPointer &&other) -> void { + auto push_back(GenericPointer &&other) -> void { if (other.empty()) { return; } else if (other.size() == 1) { @@ -277,7 +277,7 @@ template class GenericPointer { template >>> - auto push_back(const GenericPointer &other) -> void { + auto push_back(const GenericPointer &other) -> void { if (other.empty()) { return; } else if (other.size() == 1) { @@ -422,9 +422,9 @@ template class GenericPointer { /// assert(pointer.at(1).is_property()); /// assert(pointer.at(1).to_property() == "bar"); /// ``` - [[nodiscard]] auto initial() const -> GenericPointer { + [[nodiscard]] auto initial() const -> GenericPointer { assert(!this->empty()); - GenericPointer result{*this}; + GenericPointer result{*this}; result.pop_back(); return result; } @@ -441,9 +441,9 @@ template class GenericPointer { /// assert(left.concat(right) == /// sourcemeta::jsontoolkit::Pointer{"foo", "bar", "baz"}); /// ``` - auto concat(const GenericPointer &other) const - -> GenericPointer { - GenericPointer result{*this}; + auto concat(const GenericPointer &other) const + -> GenericPointer { + GenericPointer result{*this}; result.push_back(other); return result; } @@ -459,7 +459,7 @@ template class GenericPointer { /// const sourcemeta::jsontoolkit::Pointer prefix{"foo", "bar"}; /// assert(pointer.starts_with(prefix)); /// ``` - auto starts_with(const GenericPointer &other) const -> bool { + auto starts_with(const GenericPointer &other) const -> bool { return other.data.size() <= this->data.size() && std::equal(other.data.cbegin(), other.data.cend(), this->data.cbegin()); @@ -477,7 +477,7 @@ template class GenericPointer { /// const sourcemeta::jsontoolkit::Pointer prefix{"foo", "bar", "baz"}; /// assert(pointer.starts_with(prefix, tail)); /// ``` - auto starts_with(const GenericPointer &other, + auto starts_with(const GenericPointer &other, const Token &tail) const -> bool { if (other.size() == this->size() + 1) { assert(!other.empty()); @@ -498,7 +498,7 @@ template class GenericPointer { /// const sourcemeta::jsontoolkit::Pointer prefix{"foo", "bar", "qux"}; /// assert(pointer.starts_with_initial(prefix)); /// ``` - auto starts_with_initial(const GenericPointer &other) const + auto starts_with_initial(const GenericPointer &other) const -> bool { const auto prefix_size{other.size()}; if (prefix_size == 0) { @@ -529,9 +529,9 @@ template class GenericPointer { /// assert(pointer.rebase(prefix, replacement) == /// sourcemeta::jsontoolkit::Pointer{"qux", "baz"}); /// ``` - auto rebase(const GenericPointer &prefix, - const GenericPointer &replacement) const - -> GenericPointer { + auto rebase(const GenericPointer &prefix, + const GenericPointer &replacement) const + -> GenericPointer { typename Container::size_type index{0}; while (index < prefix.size()) { if (index >= this->size() || prefix.data[index] != this->data[index]) { @@ -545,7 +545,7 @@ template class GenericPointer { assert(this->starts_with(prefix)); auto new_begin{this->data.cbegin()}; std::advance(new_begin, index); - GenericPointer result{replacement}; + GenericPointer result{replacement}; std::copy(new_begin, this->data.cend(), std::back_inserter(result.data)); return result; } @@ -564,8 +564,8 @@ template class GenericPointer { /// /// If the JSON Pointer is not relative to the base, a copy of the original /// input pointer is returned. - auto resolve_from(const GenericPointer &base) const - -> GenericPointer { + auto resolve_from(const GenericPointer &base) const + -> GenericPointer { typename Container::size_type index{0}; while (index < base.size()) { if (index >= this->size() || base.data[index] != this->data[index]) { @@ -578,20 +578,20 @@ template class GenericPointer { // Make a pointer from the remaining tokens auto new_begin{this->data.cbegin()}; std::advance(new_begin, index); - GenericPointer result; + GenericPointer result; std::copy(new_begin, this->data.cend(), std::back_inserter(result.data)); return result; } /// Compare JSON Pointer instances - auto operator==(const GenericPointer &other) const noexcept + auto operator==(const GenericPointer &other) const noexcept -> bool { return this->data == other.data; } /// Overload to support ordering of JSON Pointers. Typically for sorting /// reasons. - auto operator<(const GenericPointer &other) const noexcept + auto operator<(const GenericPointer &other) const noexcept -> bool { return this->data < other.data; } diff --git a/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer_position.h b/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer_position.h index 1d9893e..8229859 100644 --- a/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer_position.h +++ b/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer_position.h @@ -43,7 +43,7 @@ namespace sourcemeta::jsontoolkit { /// ``` class SOURCEMETA_JSONTOOLKIT_JSONPOINTER_EXPORT PositionTracker { public: - using Pointer = GenericPointer; + using Pointer = GenericPointer>; using Position = std::tuple; auto operator()(const CallbackPhase phase, const JSON::Type, diff --git a/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer_token.h b/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer_token.h index 4b9eb20..de27fa9 100644 --- a/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer_token.h +++ b/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer_token.h @@ -18,7 +18,7 @@ template class GenericToken { /// precomputed hash. This is advanced functionality that should be used with /// care. GenericToken(const Property &value, - const typename Hash::property_hash_type property_hash) + const typename Hash::hash_type property_hash) : as_property{true}, property{value}, hash{property_hash}, index{0} {} /// This constructor creates an JSON Pointer token from a string. For @@ -172,7 +172,7 @@ template class GenericToken { /// assert(token.property_hash() >= 0); /// ``` [[nodiscard]] auto property_hash() const noexcept -> - typename Hash::property_hash_type { + typename Hash::hash_type { assert(this->is_property()); return this->hash; } @@ -271,7 +271,7 @@ template class GenericToken { bool as_property; Property property; - typename Hash::property_hash_type hash; + typename Hash::hash_type hash; Index index; }; diff --git a/vendor/jsontoolkit/src/jsonpointer/jsonpointer.cc b/vendor/jsontoolkit/src/jsonpointer/jsonpointer.cc index 6231239..f09b860 100644 --- a/vendor/jsontoolkit/src/jsonpointer/jsonpointer.cc +++ b/vendor/jsontoolkit/src/jsonpointer/jsonpointer.cc @@ -15,8 +15,9 @@ namespace { template