diff --git a/DEPENDENCIES b/DEPENDENCIES index e9d67a46..648a6466 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -1,7 +1,7 @@ vendorpull https://github.com/sourcemeta/vendorpull dea311b5bfb53b6926a4140267959ae334d3ecf4 -noa https://github.com/sourcemeta/noa 837e1ff981f8df45d9e2977a50f5da61d8affed4 -jsontoolkit https://github.com/sourcemeta/jsontoolkit 9685d29e2e633d71319c64b1ab2fbceab865dbf3 -hydra https://github.com/sourcemeta/hydra c0d2f53dc52d8febd3092ce873847729b9f447fb -alterschema https://github.com/sourcemeta/alterschema 36dc1933bbbdbf1f2574c309e41f510f58874838 -jsonbinpack https://github.com/sourcemeta/jsonbinpack b09b7948f90a9e9c30a2c38441f44d1c4b93b45a -blaze https://github.com/sourcemeta/blaze 43cac42dc486be24addbc2cd0aa646d18e2000f5 +noa https://github.com/sourcemeta/noa caad2e1ceedf9fd1a18686a6a6d1e2b9757ead75 +jsontoolkit https://github.com/sourcemeta/jsontoolkit 2d78929faf0f96110edfb67fa3ddf6916cf35ef7 +hydra https://github.com/sourcemeta/hydra a4a74f3cabd32f2f829f449d67339dac33f9910e +alterschema https://github.com/sourcemeta/alterschema 92e370ce9c1f0582014b54d43e388ee012dfe13d +jsonbinpack https://github.com/sourcemeta/jsonbinpack d777179441d3c703e1fda1187742541aa26836b5 +blaze https://github.com/sourcemeta/blaze b438b45e453562d882786dee0b7658f81e6fb6a0 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b370fa59..40550a2f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,11 +28,6 @@ target_link_libraries(jsonschema_cli PRIVATE sourcemeta::jsonbinpack::runtime) target_link_libraries(jsonschema_cli PRIVATE sourcemeta::blaze::compiler) target_link_libraries(jsonschema_cli PRIVATE sourcemeta::blaze::evaluator) -# TODO: This is hack to disambiguate between JSON BinPack's "compiler" module -# and Blaze's "compiler" module, where both will try to include "compiler_export.h" -# We should fix these cases properly in Noa. -target_compile_definitions(jsonschema_cli PRIVATE SOURCEMETA_BLAZE_COMPILER_EXPORT=) - configure_file(configure.h.in configure.h @ONLY) target_include_directories(jsonschema_cli PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/vendor/alterschema/src/engine/include/sourcemeta/alterschema/engine_bundle.h b/vendor/alterschema/src/engine/include/sourcemeta/alterschema/engine_bundle.h index f0fa2a1f..cfb7c145 100644 --- a/vendor/alterschema/src/engine/include/sourcemeta/alterschema/engine_bundle.h +++ b/vendor/alterschema/src/engine/include/sourcemeta/alterschema/engine_bundle.h @@ -1,7 +1,9 @@ #ifndef SOURCEMETA_ALTERSCHEMA_BUNDLE_H_ #define SOURCEMETA_ALTERSCHEMA_BUNDLE_H_ -#include "engine_export.h" +#ifndef SOURCEMETA_ALTERSCHEMA_ENGINE_EXPORT +#include +#endif #include #include diff --git a/vendor/alterschema/src/engine/include/sourcemeta/alterschema/engine_rule.h b/vendor/alterschema/src/engine/include/sourcemeta/alterschema/engine_rule.h index 35e79f10..9222a5e5 100644 --- a/vendor/alterschema/src/engine/include/sourcemeta/alterschema/engine_rule.h +++ b/vendor/alterschema/src/engine/include/sourcemeta/alterschema/engine_rule.h @@ -1,7 +1,9 @@ #ifndef SOURCEMETA_ALTERSCHEMA_ENGINE_RULE_H_ #define SOURCEMETA_ALTERSCHEMA_ENGINE_RULE_H_ -#include "engine_export.h" +#ifndef SOURCEMETA_ALTERSCHEMA_ENGINE_EXPORT +#include +#endif #include #include diff --git a/vendor/alterschema/src/engine/include/sourcemeta/alterschema/engine_transformer.h b/vendor/alterschema/src/engine/include/sourcemeta/alterschema/engine_transformer.h index 80ebd1c8..0dec7f42 100644 --- a/vendor/alterschema/src/engine/include/sourcemeta/alterschema/engine_transformer.h +++ b/vendor/alterschema/src/engine/include/sourcemeta/alterschema/engine_transformer.h @@ -1,7 +1,9 @@ #ifndef SOURCEMETA_ALTERSCHEMA_ENGINE_TRANSFORMER_H_ #define SOURCEMETA_ALTERSCHEMA_ENGINE_TRANSFORMER_H_ -#include "engine_export.h" +#ifndef SOURCEMETA_ALTERSCHEMA_ENGINE_EXPORT +#include +#endif #include #include diff --git a/vendor/alterschema/src/linter/include/sourcemeta/alterschema/linter.h b/vendor/alterschema/src/linter/include/sourcemeta/alterschema/linter.h index 97379e9b..a1e56d93 100644 --- a/vendor/alterschema/src/linter/include/sourcemeta/alterschema/linter.h +++ b/vendor/alterschema/src/linter/include/sourcemeta/alterschema/linter.h @@ -10,7 +10,9 @@ /// #include /// ``` -#include "linter_export.h" +#ifndef SOURCEMETA_ALTERSCHEMA_LINTER_EXPORT +#include +#endif #include diff --git a/vendor/alterschema/vendor/noa/cmake/noa/library.cmake b/vendor/alterschema/vendor/noa/cmake/noa/library.cmake index 9868714d..bc746774 100644 --- a/vendor/alterschema/vendor/noa/cmake/noa/library.cmake +++ b/vendor/alterschema/vendor/noa/cmake/noa/library.cmake @@ -18,6 +18,7 @@ function(noa_library) set(INCLUDE_PREFIX "include/${NOA_LIBRARY_PROJECT}") endif() + set(EXPORT_HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}_export.h") if(NOT NOA_LIBRARY_VARIANT) set(PUBLIC_HEADER "${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}.h") else() @@ -25,7 +26,7 @@ function(noa_library) endif() if(NOA_LIBRARY_SOURCES) - set(ABSOLUTE_PRIVATE_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/${NOA_LIBRARY_NAME}_export.h") + set(ABSOLUTE_PRIVATE_HEADERS "${EXPORT_HEADER_PATH}") else() set(ABSOLUTE_PRIVATE_HEADERS) endif() @@ -100,7 +101,7 @@ function(noa_library) if(NOA_LIBRARY_SOURCES) include(GenerateExportHeader) generate_export_header(${TARGET_NAME} - EXPORT_FILE_NAME ${NOA_LIBRARY_NAME}_export.h) + EXPORT_FILE_NAME ${EXPORT_HEADER_PATH}) set_target_properties(${TARGET_NAME} PROPERTIES SOVERSION "${PROJECT_VERSION_MAJOR}" @@ -108,7 +109,7 @@ function(noa_library) # To find the generated files target_include_directories(${TARGET_NAME} - PUBLIC "$") + PUBLIC "$") endif() endfunction() diff --git a/vendor/blaze/src/compiler/compile.cc b/vendor/blaze/src/compiler/compile.cc index ce1e63ab..db0e7c03 100644 --- a/vendor/blaze/src/compiler/compile.cc +++ b/vendor/blaze/src/compiler/compile.cc @@ -317,7 +317,10 @@ auto ErrorTraceOutput::operator()( const sourcemeta::jsontoolkit::WeakPointer &evaluate_path, const sourcemeta::jsontoolkit::WeakPointer &instance_location, const sourcemeta::jsontoolkit::JSON &annotation) -> void { - assert(!evaluate_path.empty()); + if (evaluate_path.empty()) { + return; + } + assert(evaluate_path.back().is_property()); if (type == EvaluationType::Pre) { diff --git a/vendor/blaze/src/compiler/compile_describe.cc b/vendor/blaze/src/compiler/compile_describe.cc index 62060632..51c88222 100644 --- a/vendor/blaze/src/compiler/compile_describe.cc +++ b/vendor/blaze/src/compiler/compile_describe.cc @@ -149,7 +149,15 @@ struct DescribeVisitor { return message.str(); } - assert(this->keyword.empty()); + if (this->keyword == "unevaluatedItems") { + std::ostringstream message; + assert(!this->instance_location.empty()); + assert(this->instance_location.back().is_index()); + message << "The array value was not expected to define the item at index " + << this->instance_location.back().to_index(); + return message.str(); + } + return "No instance is expected to succeed against the false schema"; } @@ -238,24 +246,16 @@ struct DescribeVisitor { return message.str(); } - auto operator()(const AnnotationNot &) const -> std::string { - std::ostringstream message; - message - << "The " << to_string(this->target.type()) - << " value was expected to not validate against the given subschema"; - if (!this->valid) { - message << ", but it did"; - } - - return message.str(); - } - auto operator()(const ControlLabel &) const -> std::string { return describe_reference(this->target); } auto operator()(const ControlMark &) const -> std::string { - return describe_reference(this->target); + return "The schema location was marked for future use"; + } + + auto operator()(const ControlEvaluate &) const -> std::string { + return "The instance location was marked as evaluated"; } auto operator()(const ControlJump &) const -> std::string { @@ -607,8 +607,7 @@ struct DescribeVisitor { return message.str(); } - auto operator()(const AnnotationLoopPropertiesUnevaluated &step) const - -> std::string { + auto operator()(const LoopPropertiesUnevaluated &step) const -> std::string { if (this->keyword == "unevaluatedProperties") { std::ostringstream message; if (!step.children.empty() && @@ -700,18 +699,11 @@ struct DescribeVisitor { return message.str(); } - auto operator()(const AnnotationLoopItemsUnmarked &) const -> std::string { - return unknown(); - } - - auto operator()(const AnnotationLoopItemsUnevaluated &step) const - -> std::string { + auto operator()(const LoopItemsUnevaluated &) const -> std::string { assert(this->keyword == "unevaluatedItems"); - const auto &value{step_value(step)}; std::ostringstream message; - message << "The array items not evaluated by the keyword " - << escape_string(value.index) - << ", if any, were expected to validate against this subschema"; + message << "The array items not covered by other array keywords, if any, " + "were expected to validate against this subschema"; return message.str(); } @@ -1383,6 +1375,13 @@ struct DescribeVisitor { return message.str(); } + auto operator()(const LogicalWhenDefines &step) const -> std::string { + std::ostringstream message; + message << "The object value defined the property \"" << step_value(step) + << "\""; + return message.str(); + } + auto operator()(const LogicalWhenType &step) const -> std::string { if (this->keyword == "patternProperties") { assert(!step.children.empty()); @@ -1694,9 +1693,6 @@ struct DescribeVisitor { auto operator()(const LogicalWhenArraySizeEqual &) const -> std::string { return unknown(); } - auto operator()(const LogicalWhenDefines &) const -> std::string { - return unknown(); - } auto operator()(const LoopPropertiesRegex &) const -> std::string { return unknown(); } diff --git a/vendor/blaze/src/compiler/compile_json.cc b/vendor/blaze/src/compiler/compile_json.cc index 0bb5face..e5f07187 100644 --- a/vendor/blaze/src/compiler/compile_json.cc +++ b/vendor/blaze/src/compiler/compile_json.cc @@ -113,29 +113,6 @@ auto value_to_json(const T &value) -> sourcemeta::jsontoolkit::JSON { result.assign("value", std::move(map)); return result; - } else if constexpr (std::is_same_v) { - result.assign("type", - sourcemeta::jsontoolkit::JSON{"items-annotation-keywords"}); - sourcemeta::jsontoolkit::JSON data{ - sourcemeta::jsontoolkit::JSON::make_object()}; - data.assign("index", sourcemeta::jsontoolkit::JSON{value.index}); - - sourcemeta::jsontoolkit::JSON mask{ - sourcemeta::jsontoolkit::JSON::make_array()}; - for (const auto &keyword : value.mask) { - mask.push_back(sourcemeta::jsontoolkit::JSON{keyword}); - } - data.assign("mask", std::move(mask)); - - sourcemeta::jsontoolkit::JSON filter{ - sourcemeta::jsontoolkit::JSON::make_array()}; - for (const auto &keyword : value.filter) { - filter.push_back(sourcemeta::jsontoolkit::JSON{keyword}); - } - data.assign("filter", std::move(filter)); - - result.assign("value", std::move(data)); - return result; } else if constexpr (std::is_same_v) { result.assign("type", sourcemeta::jsontoolkit::JSON{"indexed-json"}); sourcemeta::jsontoolkit::JSON data{ @@ -182,6 +159,11 @@ auto value_to_json(const T &value) -> sourcemeta::jsontoolkit::JSON { data.push_back(sourcemeta::jsontoolkit::JSON{value.second}); result.assign("value", std::move(data)); return result; + } else if constexpr (std::is_same_v) { + result.assign("type", sourcemeta::jsontoolkit::JSON{"pointer"}); + result.assign("value", sourcemeta::jsontoolkit::JSON{ + sourcemeta::jsontoolkit::to_string(value)}); + return result; } else { static_assert(std::is_same_v); return sourcemeta::jsontoolkit::JSON{nullptr}; @@ -270,12 +252,6 @@ struct StepVisitor { AnnotationWhenArraySizeGreater) HANDLE_STEP("annotation", "to-parent", AnnotationToParent) HANDLE_STEP("annotation", "basename-to-parent", AnnotationBasenameToParent) - HANDLE_STEP("annotation", "loop-properties-unevaluated", - AnnotationLoopPropertiesUnevaluated) - HANDLE_STEP("annotation", "loop-items-unmarked", AnnotationLoopItemsUnmarked) - HANDLE_STEP("annotation", "loop-items-unevaluated", - AnnotationLoopItemsUnevaluated) - HANDLE_STEP("annotation", "not", AnnotationNot) HANDLE_STEP("logical", "not", LogicalNot) HANDLE_STEP("logical", "or", LogicalOr) HANDLE_STEP("logical", "and", LogicalAnd) @@ -285,6 +261,8 @@ struct StepVisitor { HANDLE_STEP("logical", "when-defines", LogicalWhenDefines) HANDLE_STEP("logical", "when-array-size-greater", LogicalWhenArraySizeGreater) HANDLE_STEP("logical", "when-array-size-equal", LogicalWhenArraySizeEqual) + HANDLE_STEP("loop", "properties-unevaluated", LoopPropertiesUnevaluated) + HANDLE_STEP("loop", "items-unevaluated", LoopItemsUnevaluated) HANDLE_STEP("loop", "properties-match", LoopPropertiesMatch) HANDLE_STEP("loop", "properties", LoopProperties) HANDLE_STEP("loop", "properties-regex", LoopPropertiesRegex) @@ -296,6 +274,7 @@ struct StepVisitor { HANDLE_STEP("loop", "contains", LoopContains) HANDLE_STEP("control", "label", ControlLabel) HANDLE_STEP("control", "mark", ControlMark) + HANDLE_STEP("control", "evaluate", ControlEvaluate) HANDLE_STEP("control", "jump", ControlJump) HANDLE_STEP("control", "dynamic-anchor-jump", ControlDynamicAnchorJump) diff --git a/vendor/blaze/src/compiler/default_compiler_2019_09.h b/vendor/blaze/src/compiler/default_compiler_2019_09.h index 9de486e3..591c7ad7 100644 --- a/vendor/blaze/src/compiler/default_compiler_2019_09.h +++ b/vendor/blaze/src/compiler/default_compiler_2019_09.h @@ -39,7 +39,7 @@ auto compiler_2019_09_applicator_dependentschemas( if (!dependency.is_boolean() || !dependency.to_boolean()) { children.push_back(make( - false, context, schema_context, relative_dynamic_context, + true, context, schema_context, relative_dynamic_context, ValueString{dependent}, compile(context, schema_context, relative_dynamic_context, {dependent}, sourcemeta::jsontoolkit::empty_pointer))); @@ -100,9 +100,10 @@ auto compiler_2019_09_core_annotation(const Context &context, schema_context.schema.at(dynamic_context.keyword)})}; } -auto compiler_2019_09_applicator_contains_conditional_annotate( +auto compiler_2019_09_applicator_contains_with_options( const Context &context, const SchemaContext &schema_context, - const DynamicContext &dynamic_context, const bool annotate) -> Template { + const DynamicContext &dynamic_context, const bool annotate, + const bool track_evaluation) -> Template { if (schema_context.schema.defines("type") && schema_context.schema.at("type").is_string() && schema_context.schema.at("type").to_string() != "array") { @@ -156,13 +157,15 @@ auto compiler_2019_09_applicator_contains_conditional_annotate( // an annotation "true" } + if (track_evaluation) { + children.push_back(make(true, context, schema_context, + relative_dynamic_context, + ValuePointer{})); + } + return {make( true, context, schema_context, dynamic_context, - ValueRange{minimum, maximum, - // TODO: We only need to be exhaustive here if - // `unevaluatedItems` is in use on the schema. Can we - // pre-determine that and speed things up if not? - annotate}, + ValueRange{minimum, maximum, annotate || track_evaluation}, std::move(children))}; } @@ -170,33 +173,33 @@ auto compiler_2019_09_applicator_contains(const Context &context, const SchemaContext &schema_context, const DynamicContext &dynamic_context) -> Template { - return compiler_2019_09_applicator_contains_conditional_annotate( - context, schema_context, dynamic_context, false); + return compiler_2019_09_applicator_contains_with_options( + context, schema_context, dynamic_context, false, false); } auto compiler_2019_09_applicator_additionalproperties( const Context &context, const SchemaContext &schema_context, const DynamicContext &dynamic_context) -> Template { - return compiler_draft4_applicator_additionalproperties_conditional_annotation( + return compiler_draft4_applicator_additionalproperties_with_options( context, schema_context, dynamic_context, - context.uses_unevaluated_properties || context.mode == Mode::Exhaustive); + context.mode == Mode::Exhaustive, context.uses_unevaluated_properties); } auto compiler_2019_09_applicator_items(const Context &context, const SchemaContext &schema_context, const DynamicContext &dynamic_context) -> Template { - return compiler_draft4_applicator_items_conditional_annotation( + return compiler_draft4_applicator_items_with_options( context, schema_context, dynamic_context, - context.uses_unevaluated_items || context.mode == Mode::Exhaustive); + context.mode == Mode::Exhaustive, context.uses_unevaluated_items); } auto compiler_2019_09_applicator_additionalitems( const Context &context, const SchemaContext &schema_context, const DynamicContext &dynamic_context) -> Template { - return compiler_draft4_applicator_additionalitems_conditional_annotation( + return compiler_draft4_applicator_additionalitems_with_options( context, schema_context, dynamic_context, - context.uses_unevaluated_items || context.mode == Mode::Exhaustive); + context.mode == Mode::Exhaustive, context.uses_unevaluated_items); } auto compiler_2019_09_applicator_unevaluateditems( @@ -211,31 +214,16 @@ auto compiler_2019_09_applicator_unevaluateditems( Template children{compile(context, schema_context, relative_dynamic_context, sourcemeta::jsontoolkit::empty_pointer, sourcemeta::jsontoolkit::empty_pointer)}; - children.push_back(make( - true, context, schema_context, relative_dynamic_context, - sourcemeta::jsontoolkit::JSON{true})); - - if (schema_context.vocabularies.contains( - "https://json-schema.org/draft/2019-09/vocab/applicator")) { - return {make( - true, context, schema_context, dynamic_context, - ValueItemsAnnotationKeywords{ - "items", {}, {"items", "additionalItems", "unevaluatedItems"}}, - std::move(children))}; - } else if (schema_context.vocabularies.contains( - "https://json-schema.org/draft/2020-12/vocab/applicator")) { - return {make( - true, context, schema_context, dynamic_context, - ValueItemsAnnotationKeywords{ - "prefixItems", - {"contains"}, - {"prefixItems", "items", "contains", "unevaluatedItems"}}, - std::move(children))}; - } else { - return {make( - true, context, schema_context, dynamic_context, - ValueString{"unevaluatedItems"}, std::move(children))}; + + if (context.mode == Mode::Exhaustive) { + children.push_back(make( + true, context, schema_context, relative_dynamic_context, + sourcemeta::jsontoolkit::JSON{true})); } + + return {make(true, context, schema_context, + dynamic_context, ValueNone{}, + std::move(children))}; } auto compiler_2019_09_applicator_unevaluatedproperties( @@ -247,31 +235,18 @@ auto compiler_2019_09_applicator_unevaluatedproperties( return {}; } - ValueStrings dependencies{"unevaluatedProperties"}; - - if (schema_context.vocabularies.contains( - "https://json-schema.org/draft/2019-09/vocab/applicator")) { - dependencies.push_back("properties"); - dependencies.push_back("patternProperties"); - dependencies.push_back("additionalProperties"); - } - - if (schema_context.vocabularies.contains( - "https://json-schema.org/draft/2020-12/vocab/applicator")) { - dependencies.push_back("properties"); - dependencies.push_back("patternProperties"); - dependencies.push_back("additionalProperties"); - } - Template children{compile(context, schema_context, relative_dynamic_context, sourcemeta::jsontoolkit::empty_pointer, sourcemeta::jsontoolkit::empty_pointer)}; - children.push_back(make( - true, context, schema_context, relative_dynamic_context, ValueNone{})); - return {make( - true, context, schema_context, dynamic_context, std::move(dependencies), - std::move(children))}; + if (context.mode == Mode::Exhaustive) { + children.push_back(make( + true, context, schema_context, relative_dynamic_context, ValueNone{})); + } + + return {make(true, context, schema_context, + dynamic_context, ValueNone{}, + std::move(children))}; } auto compiler_2019_09_core_recursiveref(const Context &context, @@ -297,17 +272,17 @@ auto compiler_2019_09_core_recursiveref(const Context &context, auto compiler_2019_09_applicator_properties( const Context &context, const SchemaContext &schema_context, const DynamicContext &dynamic_context) -> Template { - return compiler_draft4_applicator_properties_conditional_annotation( + return compiler_draft4_applicator_properties_with_options( context, schema_context, dynamic_context, - context.uses_unevaluated_properties || context.mode == Mode::Exhaustive); + context.mode == Mode::Exhaustive, context.uses_unevaluated_properties); } auto compiler_2019_09_applicator_patternproperties( const Context &context, const SchemaContext &schema_context, const DynamicContext &dynamic_context) -> Template { - return compiler_draft4_applicator_patternproperties_conditional_annotation( + return compiler_draft4_applicator_patternproperties_with_options( context, schema_context, dynamic_context, - context.uses_unevaluated_properties || context.mode == Mode::Exhaustive); + context.mode == Mode::Exhaustive, context.uses_unevaluated_properties); } } // namespace internal diff --git a/vendor/blaze/src/compiler/default_compiler_2020_12.h b/vendor/blaze/src/compiler/default_compiler_2020_12.h index 07810943..755149d8 100644 --- a/vendor/blaze/src/compiler/default_compiler_2020_12.h +++ b/vendor/blaze/src/compiler/default_compiler_2020_12.h @@ -15,7 +15,7 @@ auto compiler_2020_12_applicator_prefixitems( const DynamicContext &dynamic_context) -> Template { return compiler_draft4_applicator_items_array( context, schema_context, dynamic_context, - context.uses_unevaluated_items || context.mode == Mode::Exhaustive); + context.mode == Mode::Exhaustive, context.uses_unevaluated_items); } auto compiler_2020_12_applicator_items(const Context &context, @@ -29,16 +29,16 @@ auto compiler_2020_12_applicator_items(const Context &context, return compiler_draft4_applicator_additionalitems_from_cursor( context, schema_context, dynamic_context, cursor, - context.uses_unevaluated_items || context.mode == Mode::Exhaustive); + context.mode == Mode::Exhaustive, context.uses_unevaluated_items); } auto compiler_2020_12_applicator_contains(const Context &context, const SchemaContext &schema_context, const DynamicContext &dynamic_context) -> Template { - return compiler_2019_09_applicator_contains_conditional_annotate( + return compiler_2019_09_applicator_contains_with_options( context, schema_context, dynamic_context, - context.uses_unevaluated_items || context.mode == Mode::Exhaustive); + context.mode == Mode::Exhaustive, context.uses_unevaluated_items); } auto compiler_2020_12_core_dynamicref(const Context &context, diff --git a/vendor/blaze/src/compiler/default_compiler_draft4.h b/vendor/blaze/src/compiler/default_compiler_draft4.h index f0e7c62f..bd657be2 100644 --- a/vendor/blaze/src/compiler/default_compiler_draft4.h +++ b/vendor/blaze/src/compiler/default_compiler_draft4.h @@ -382,9 +382,10 @@ auto compiler_draft4_applicator_oneof(const Context &context, std::move(disjunctors))}; } -auto compiler_draft4_applicator_properties_conditional_annotation( +auto compiler_draft4_applicator_properties_with_options( const Context &context, const SchemaContext &schema_context, - const DynamicContext &dynamic_context, const bool annotate) -> Template { + const DynamicContext &dynamic_context, const bool annotate, + const bool track_evaluation) -> Template { assert(schema_context.schema.at(dynamic_context.keyword).is_object()); if (schema_context.schema.at(dynamic_context.keyword).empty()) { return {}; @@ -501,6 +502,12 @@ auto compiler_draft4_applicator_properties_conditional_annotation( Template children; for (auto &&[name, substeps] : properties) { + if (track_evaluation) { + substeps.push_back(make(true, context, schema_context, + relative_dynamic_context, + ValuePointer{name})); + } + if (annotate) { substeps.push_back(make( true, context, schema_context, relative_dynamic_context, @@ -579,13 +586,14 @@ auto compiler_draft4_applicator_properties_conditional_annotation( auto compiler_draft4_applicator_properties( const Context &context, const SchemaContext &schema_context, const DynamicContext &dynamic_context) -> Template { - return compiler_draft4_applicator_properties_conditional_annotation( - context, schema_context, dynamic_context, false); + return compiler_draft4_applicator_properties_with_options( + context, schema_context, dynamic_context, false, false); } -auto compiler_draft4_applicator_patternproperties_conditional_annotation( +auto compiler_draft4_applicator_patternproperties_with_options( const Context &context, const SchemaContext &schema_context, - const DynamicContext &dynamic_context, const bool annotate) -> Template { + const DynamicContext &dynamic_context, const bool annotate, + const bool track_evaluation) -> Template { assert(schema_context.schema.at(dynamic_context.keyword).is_object()); if (schema_context.schema.at(dynamic_context.keyword).empty()) { return {}; @@ -614,14 +622,17 @@ auto compiler_draft4_applicator_patternproperties_conditional_annotation( {pattern}, {})}; if (annotate) { - // The evaluator will make sure the same annotation is not reported twice. - // For example, if the same property matches more than one subschema in - // `patternProperties` substeps.push_back(make( true, context, schema_context, relative_dynamic_context, ValueNone{})); } + if (track_evaluation) { + substeps.push_back(make(true, context, schema_context, + relative_dynamic_context, + ValuePointer{})); + } + // If the `patternProperties` subschema for the given pattern does // nothing, then we can avoid generating an entire loop for it if (!substeps.empty()) { @@ -649,13 +660,14 @@ auto compiler_draft4_applicator_patternproperties_conditional_annotation( auto compiler_draft4_applicator_patternproperties( const Context &context, const SchemaContext &schema_context, const DynamicContext &dynamic_context) -> Template { - return compiler_draft4_applicator_patternproperties_conditional_annotation( - context, schema_context, dynamic_context, false); + return compiler_draft4_applicator_patternproperties_with_options( + context, schema_context, dynamic_context, false, false); } -auto compiler_draft4_applicator_additionalproperties_conditional_annotation( +auto compiler_draft4_applicator_additionalproperties_with_options( const Context &context, const SchemaContext &schema_context, - const DynamicContext &dynamic_context, const bool annotate) -> Template { + const DynamicContext &dynamic_context, const bool annotate, + const bool track_evaluation) -> Template { if (schema_context.schema.defines("type") && schema_context.schema.at("type").is_string() && schema_context.schema.at("type").to_string() != "object") { @@ -671,6 +683,12 @@ auto compiler_draft4_applicator_additionalproperties_conditional_annotation( true, context, schema_context, relative_dynamic_context, ValueNone{})); } + if (track_evaluation) { + children.push_back(make(true, context, schema_context, + relative_dynamic_context, + ValuePointer{})); + } + ValuePropertyFilter filter; if (schema_context.schema.defines("properties") && @@ -726,8 +744,8 @@ auto compiler_draft4_applicator_additionalproperties_conditional_annotation( auto compiler_draft4_applicator_additionalproperties( const Context &context, const SchemaContext &schema_context, const DynamicContext &dynamic_context) -> Template { - return compiler_draft4_applicator_additionalproperties_conditional_annotation( - context, schema_context, dynamic_context, false); + return compiler_draft4_applicator_additionalproperties_with_options( + context, schema_context, dynamic_context, false, false); } auto compiler_draft4_validation_pattern(const Context &context, @@ -800,27 +818,21 @@ auto compiler_draft4_applicator_not(const Context &context, const SchemaContext &schema_context, const DynamicContext &dynamic_context) -> Template { - // Only emit a `not` instruction that keeps track of - // dropping annotations if we really need it - if (context.mode != Mode::FastValidation || - context.uses_unevaluated_properties || context.uses_unevaluated_items) { - return {make( - true, context, schema_context, dynamic_context, ValueNone{}, - compile(context, schema_context, relative_dynamic_context, - sourcemeta::jsontoolkit::empty_pointer, - sourcemeta::jsontoolkit::empty_pointer))}; - } else { - return {make( - true, context, schema_context, dynamic_context, ValueNone{}, - compile(context, schema_context, relative_dynamic_context, - sourcemeta::jsontoolkit::empty_pointer, - sourcemeta::jsontoolkit::empty_pointer))}; - } + return {make(true, context, schema_context, dynamic_context, + // Only emit a `not` instruction that keeps track of + // evaluation if we really need it + ValueBoolean{context.uses_unevaluated_properties || + context.uses_unevaluated_items}, + compile(context, schema_context, + relative_dynamic_context, + sourcemeta::jsontoolkit::empty_pointer, + sourcemeta::jsontoolkit::empty_pointer))}; } auto compiler_draft4_applicator_items_array( const Context &context, const SchemaContext &schema_context, - const DynamicContext &dynamic_context, const bool annotate) -> Template { + const DynamicContext &dynamic_context, const bool annotate, + const bool track_evaluation) -> Template { assert(schema_context.schema.at(dynamic_context.keyword).is_array()); const auto items_size{ schema_context.schema.at(dynamic_context.keyword).size()}; @@ -848,9 +860,16 @@ auto compiler_draft4_applicator_items_array( const auto &array{ schema_context.schema.at(dynamic_context.keyword).as_array()}; for (auto iterator{array.cbegin()}; iterator != array.cend(); ++iterator) { - subschemas.push_back(compile(context, schema_context, - relative_dynamic_context, {subschemas.size()}, - {subschemas.size()})); + Template children{compile(context, schema_context, relative_dynamic_context, + {subschemas.size()}, {subschemas.size()})}; + + if (track_evaluation) { + children.push_back(make( + true, context, schema_context, relative_dynamic_context, + ValuePointer{subschemas.size()})); + } + + subschemas.push_back(std::move(children)); } Template children; @@ -895,9 +914,10 @@ auto compiler_draft4_applicator_items_array( std::move(children))}; } -auto compiler_draft4_applicator_items_conditional_annotation( +auto compiler_draft4_applicator_items_with_options( const Context &context, const SchemaContext &schema_context, - const DynamicContext &dynamic_context, const bool annotate) -> Template { + const DynamicContext &dynamic_context, const bool annotate, + const bool track_evaluation) -> Template { if (schema_context.schema.defines("type") && schema_context.schema.at("type").is_string() && schema_context.schema.at("type").to_string() != "array") { @@ -905,58 +925,77 @@ auto compiler_draft4_applicator_items_conditional_annotation( } if (is_schema(schema_context.schema.at(dynamic_context.keyword))) { - if (annotate) { + if (annotate || track_evaluation) { Template children; + Template subchildren{compile(context, schema_context, + relative_dynamic_context, + sourcemeta::jsontoolkit::empty_pointer, + sourcemeta::jsontoolkit::empty_pointer)}; + children.push_back(make( true, context, schema_context, relative_dynamic_context, - ValueUnsignedInteger{0}, - compile(context, schema_context, relative_dynamic_context, - sourcemeta::jsontoolkit::empty_pointer, - sourcemeta::jsontoolkit::empty_pointer))); - children.push_back(make( - true, context, schema_context, relative_dynamic_context, - sourcemeta::jsontoolkit::JSON{true})); + ValueUnsignedInteger{0}, std::move(subchildren))); + + if (annotate) { + children.push_back(make( + true, context, schema_context, relative_dynamic_context, + sourcemeta::jsontoolkit::JSON{true})); + } + + if (track_evaluation) { + children.push_back(make(true, context, schema_context, + relative_dynamic_context, + ValuePointer{})); + } return {make( false, context, schema_context, dynamic_context, sourcemeta::jsontoolkit::JSON::Type::Array, std::move(children))}; } - return {make( - true, context, schema_context, dynamic_context, ValueUnsignedInteger{0}, - compile(context, schema_context, relative_dynamic_context, - sourcemeta::jsontoolkit::empty_pointer, - sourcemeta::jsontoolkit::empty_pointer))}; + Template children{compile(context, schema_context, relative_dynamic_context, + sourcemeta::jsontoolkit::empty_pointer, + sourcemeta::jsontoolkit::empty_pointer)}; + if (track_evaluation) { + children.push_back(make(true, context, schema_context, + relative_dynamic_context, + ValuePointer{})); + } + + return {make(true, context, schema_context, dynamic_context, + ValueUnsignedInteger{0}, std::move(children))}; } - return compiler_draft4_applicator_items_array(context, schema_context, - dynamic_context, annotate); + return compiler_draft4_applicator_items_array( + context, schema_context, dynamic_context, annotate, track_evaluation); } auto compiler_draft4_applicator_items(const Context &context, const SchemaContext &schema_context, const DynamicContext &dynamic_context) -> Template { - return compiler_draft4_applicator_items_conditional_annotation( - context, schema_context, dynamic_context, false); + return compiler_draft4_applicator_items_with_options( + context, schema_context, dynamic_context, false, false); } auto compiler_draft4_applicator_additionalitems_from_cursor( const Context &context, const SchemaContext &schema_context, const DynamicContext &dynamic_context, const std::size_t cursor, - const bool annotate) -> Template { + const bool annotate, const bool track_evaluation) -> Template { if (schema_context.schema.defines("type") && schema_context.schema.at("type").is_string() && schema_context.schema.at("type").to_string() != "array") { return {}; } + Template subchildren{compile(context, schema_context, + relative_dynamic_context, + sourcemeta::jsontoolkit::empty_pointer, + sourcemeta::jsontoolkit::empty_pointer)}; + Template children{ make(true, context, schema_context, relative_dynamic_context, - ValueUnsignedInteger{cursor}, - compile(context, schema_context, relative_dynamic_context, - sourcemeta::jsontoolkit::empty_pointer, - sourcemeta::jsontoolkit::empty_pointer))}; + ValueUnsignedInteger{cursor}, std::move(subchildren))}; if (annotate) { children.push_back(make( @@ -964,14 +1003,21 @@ auto compiler_draft4_applicator_additionalitems_from_cursor( sourcemeta::jsontoolkit::JSON{true})); } + if (track_evaluation) { + children.push_back(make(true, context, schema_context, + relative_dynamic_context, + ValuePointer{})); + } + return {make( false, context, schema_context, dynamic_context, ValueUnsignedInteger{cursor}, std::move(children))}; } -auto compiler_draft4_applicator_additionalitems_conditional_annotation( +auto compiler_draft4_applicator_additionalitems_with_options( const Context &context, const SchemaContext &schema_context, - const DynamicContext &dynamic_context, const bool annotate) -> Template { + const DynamicContext &dynamic_context, const bool annotate, + const bool track_evaluation) -> Template { if (schema_context.schema.defines("type") && schema_context.schema.at("type").is_string() && schema_context.schema.at("type").to_string() != "array") { @@ -992,14 +1038,15 @@ auto compiler_draft4_applicator_additionalitems_conditional_annotation( : 0}; return compiler_draft4_applicator_additionalitems_from_cursor( - context, schema_context, dynamic_context, cursor, annotate); + context, schema_context, dynamic_context, cursor, annotate, + track_evaluation); } auto compiler_draft4_applicator_additionalitems( const Context &context, const SchemaContext &schema_context, const DynamicContext &dynamic_context) -> Template { - return compiler_draft4_applicator_additionalitems_conditional_annotation( - context, schema_context, dynamic_context, false); + return compiler_draft4_applicator_additionalitems_with_options( + context, schema_context, dynamic_context, false, false); } auto compiler_draft4_applicator_dependencies( diff --git a/vendor/blaze/src/compiler/include/sourcemeta/blaze/compiler.h b/vendor/blaze/src/compiler/include/sourcemeta/blaze/compiler.h index 994c22ca..7df0afc6 100644 --- a/vendor/blaze/src/compiler/include/sourcemeta/blaze/compiler.h +++ b/vendor/blaze/src/compiler/include/sourcemeta/blaze/compiler.h @@ -2,7 +2,7 @@ #define SOURCEMETA_BLAZE_COMPILER_COMPILE_H_ #ifndef SOURCEMETA_BLAZE_COMPILER_EXPORT -#include "compiler_export.h" +#include #endif #include diff --git a/vendor/blaze/src/compiler/include/sourcemeta/blaze/compiler_error.h b/vendor/blaze/src/compiler/include/sourcemeta/blaze/compiler_error.h index 50acf7ed..f7d72da6 100644 --- a/vendor/blaze/src/compiler/include/sourcemeta/blaze/compiler_error.h +++ b/vendor/blaze/src/compiler/include/sourcemeta/blaze/compiler_error.h @@ -2,7 +2,7 @@ #define SOURCEMETA_BLAZE_COMPILER_ERROR_H #ifndef SOURCEMETA_BLAZE_COMPILER_EXPORT -#include "compiler_export.h" +#include #endif #include diff --git a/vendor/blaze/src/evaluator/context.cc b/vendor/blaze/src/evaluator/context.cc index ed1a9bb6..7531687f 100644 --- a/vendor/blaze/src/evaluator/context.cc +++ b/vendor/blaze/src/evaluator/context.cc @@ -16,8 +16,8 @@ auto EvaluationContext::prepare(const sourcemeta::jsontoolkit::JSON &instance) this->instances_.emplace_back(instance); this->labels.clear(); this->property_as_instance = false; - this->annotation_blacklist.clear(); - this->annotations_.clear(); + this->evaluated_.clear(); + this->evaluated_blacklist_.clear(); } auto EvaluationContext::push_without_traverse( @@ -79,8 +79,8 @@ auto EvaluationContext::pop(const bool dynamic) -> void { assert(!this->frame_sizes.empty()); const auto &sizes{this->frame_sizes.back()}; this->evaluate_path_.pop_back(sizes.first); - this->instance_location_.pop_back(sizes.second); if (sizes.second > 0) { + this->instance_location_.pop_back(sizes.second); this->instances_.pop_back(); } @@ -92,130 +92,6 @@ auto EvaluationContext::pop(const bool dynamic) -> void { } } -// TODO: At least currently, we only need to mask if a schema -// makes use of `unevaluatedProperties` or `unevaluatedItems` -// Detect if a schema does need this so if not, we avoid -// an unnecessary copy -auto EvaluationContext::mask() -> void { - this->annotation_blacklist.push_back(this->evaluate_path_); -} - -auto EvaluationContext::annotate( - const sourcemeta::jsontoolkit::WeakPointer ¤t_instance_location, - const sourcemeta::jsontoolkit::JSON &value) - -> std::pair, - bool> { - const auto result{this->annotations_.insert({current_instance_location, {}}) - .first->second.insert({this->evaluate_path(), {}}) - .first->second.insert(value)}; - return {*(result.first), result.second}; -} - -auto EvaluationContext::defines_any_annotation( - const std::string &expected_keyword) const -> bool { - const auto instance_location_result{ - this->annotations_.find(this->instance_location_)}; - if (instance_location_result == this->annotations_.end()) { - return false; - } - - for (const auto &[schema_location, schema_annotations] : - instance_location_result->second) { - assert(!schema_location.empty()); - const auto &keyword{schema_location.back()}; - - if (keyword.is_property() && expected_keyword == keyword.to_property() && - !schema_annotations.empty() && - schema_location.initial().starts_with(this->evaluate_path_)) { - bool blacklisted = false; - for (const auto &masked : this->annotation_blacklist) { - if (schema_location.starts_with(masked) && - !this->evaluate_path_.starts_with(masked)) { - blacklisted = true; - break; - } - } - - if (!blacklisted) { - return true; - } - } - } - - return false; -} - -auto EvaluationContext::defines_sibling_annotation( - const std::vector &keywords, - const sourcemeta::jsontoolkit::JSON &value) const -> bool { - if (keywords.empty()) { - return false; - } - - const auto instance_location_result{ - this->annotations_.find(this->instance_location_)}; - if (instance_location_result == this->annotations_.end()) { - return false; - } - - for (const auto &[schema_location, schema_annotations] : - instance_location_result->second) { - assert(!schema_location.empty()); - const auto &keyword{schema_location.back()}; - - if (keyword.is_property() && - std::find(keywords.cbegin(), keywords.cend(), keyword.to_property()) != - keywords.cend() && - schema_annotations.contains(value) && - schema_location.initial().starts_with(this->evaluate_path_.initial())) { - bool blacklisted = false; - for (const auto &masked : this->annotation_blacklist) { - if (schema_location.starts_with(masked) && - !this->evaluate_path_.starts_with(masked)) { - blacklisted = true; - break; - } - } - - if (!blacklisted) { - return true; - } - } - } - - return false; -} - -auto EvaluationContext::largest_annotation_index( - const std::string &expected_keyword) const -> std::uint64_t { - // TODO: We should be taking masks into account - std::uint64_t result{0}; - - const auto instance_location_result{ - this->annotations_.find(this->instance_location_)}; - if (instance_location_result == this->annotations_.end()) { - return result; - } - - for (const auto &[schema_location, schema_annotations] : - instance_location_result->second) { - assert(!schema_location.empty()); - const auto &keyword{schema_location.back()}; - if (!keyword.is_property() || expected_keyword != keyword.to_property()) { - continue; - } - - for (const auto &annotation : schema_annotations) { - if (annotation.is_integer() && annotation.is_positive()) { - result = std::max( - result, static_cast(annotation.to_integer()) + 1); - } - } - } - - return result; -} - auto EvaluationContext::enter( const sourcemeta::jsontoolkit::WeakPointer::Token::Property &property) -> void { @@ -317,4 +193,48 @@ auto EvaluationContext::find_dynamic_anchor(const std::string &anchor) const return std::nullopt; } +auto EvaluationContext::evaluate() -> void { + this->evaluated_.emplace_back(this->instance_location_, this->evaluate_path_); +} + +auto EvaluationContext::evaluate( + const sourcemeta::jsontoolkit::Pointer &relative_instance_location) + -> void { + auto new_instance_location = this->instance_location_; + new_instance_location.push_back(relative_instance_location); + this->evaluated_.emplace_back(std::move(new_instance_location), + this->evaluate_path_); +} + +auto EvaluationContext::is_evaluated( + sourcemeta::jsontoolkit::WeakPointer::Token &&token) const -> bool { + auto expected_instance_location = this->instance_location_; + // TODO: Allow directly pushing back a token + expected_instance_location.push_back( + sourcemeta::jsontoolkit::WeakPointer{std::move(token)}); + + for (const auto &entry : this->evaluated_) { + if ((entry.first == expected_instance_location || + entry.first == this->instance_location_) && + // Its not possible to affect cousins + entry.second.starts_with(this->evaluate_path_.initial())) { + // Handle "not" + for (const auto &mask : this->evaluated_blacklist_) { + if (entry.second.starts_with(mask) && + !this->evaluate_path_.starts_with(mask)) { + return false; + } + } + + return true; + } + } + + return false; +} + +auto EvaluationContext::unevaluate() -> void { + this->evaluated_blacklist_.push_back(this->evaluate_path_); +} + } // namespace sourcemeta::blaze diff --git a/vendor/blaze/src/evaluator/evaluator.cc b/vendor/blaze/src/evaluator/evaluator.cc index b844271a..c5fd134c 100644 --- a/vendor/blaze/src/evaluator/evaluator.cc +++ b/vendor/blaze/src/evaluator/evaluator.cc @@ -120,6 +120,16 @@ auto evaluate_step(const sourcemeta::blaze::Template::value_type &step, } \ bool result{false}; +#define EVALUATE_BEGIN_NO_PRECONDITION_AND_NO_PUSH(step_category, step_type) \ + SOURCEMETA_TRACE_END(trace_dispatch_id, "Dispatch"); \ + SOURCEMETA_TRACE_START(trace_id, STRINGIFY(step_type)); \ + const auto &step_category{std::get(step)}; \ + if (step_category.report && callback.has_value()) { \ + callback.value()(EvaluationType::Pre, true, step, context.evaluate_path(), \ + context.instance_location(), context.null); \ + } \ + bool result{true}; + #define EVALUATE_END(step_category, step_type) \ if (step_category.report && callback.has_value()) { \ callback.value()(EvaluationType::Post, result, step, \ @@ -130,6 +140,15 @@ auto evaluate_step(const sourcemeta::blaze::Template::value_type &step, SOURCEMETA_TRACE_END(trace_id, STRINGIFY(step_type)); \ return result; +#define EVALUATE_END_NO_POP(step_category, step_type) \ + if (step_category.report && callback.has_value()) { \ + callback.value()(EvaluationType::Post, result, step, \ + context.evaluate_path(), context.instance_location(), \ + context.null); \ + } \ + SOURCEMETA_TRACE_END(trace_id, STRINGIFY(step_type)); \ + return result; + // As a safety guard, only emit the annotation if it didn't exist already. // Otherwise we risk confusing consumers @@ -143,18 +162,14 @@ auto evaluate_step(const sourcemeta::blaze::Template::value_type &step, SOURCEMETA_TRACE_END(trace_id, STRINGIFY(step_type)); \ return true; \ } \ - const auto annotation_result{ \ - context.annotate(destination, annotation_value)}; \ context.push(step_category.relative_schema_location, \ step_category.relative_instance_location, \ step_category.schema_resource, step_category.dynamic); \ - if (annotation_result.second && step_category.report && \ - callback.has_value()) { \ + if (step_category.report && callback.has_value()) { \ callback.value()(EvaluationType::Pre, true, step, context.evaluate_path(), \ destination, context.null); \ callback.value()(EvaluationType::Post, true, step, \ - context.evaluate_path(), destination, \ - annotation_result.first); \ + context.evaluate_path(), destination, annotation_value); \ } \ context.pop(step_category.dynamic); \ SOURCEMETA_TRACE_END(trace_id, STRINGIFY(step_type)); \ @@ -164,18 +179,14 @@ auto evaluate_step(const sourcemeta::blaze::Template::value_type &step, destination, annotation_value) \ SOURCEMETA_TRACE_START(trace_id, STRINGIFY(step_type)); \ const auto &step_category{std::get(step)}; \ - const auto annotation_result{ \ - context.annotate(destination, annotation_value)}; \ context.push(step_category.relative_schema_location, \ step_category.relative_instance_location, \ step_category.schema_resource, step_category.dynamic); \ - if (annotation_result.second && step_category.report && \ - callback.has_value()) { \ + if (step_category.report && callback.has_value()) { \ callback.value()(EvaluationType::Pre, true, step, context.evaluate_path(), \ destination, context.null); \ callback.value()(EvaluationType::Post, true, step, \ - context.evaluate_path(), destination, \ - annotation_result.first); \ + context.evaluate_path(), destination, annotation_value); \ } \ context.pop(step_category.dynamic); \ SOURCEMETA_TRACE_END(trace_id, STRINGIFY(step_type)); \ @@ -629,10 +640,30 @@ auto evaluate_step(const sourcemeta::blaze::Template::value_type &step, } case IS_STEP(ControlMark): { - SOURCEMETA_TRACE_START(trace_id, "ControlMark"); - const auto &control{std::get(step)}; + EVALUATE_BEGIN_NO_PRECONDITION_AND_NO_PUSH(control, ControlMark); context.mark(control.value, control.children); - SOURCEMETA_TRACE_END(trace_id, "ControlMark"); + EVALUATE_END_NO_POP(control, ControlMark); + } + + case IS_STEP(ControlEvaluate): { + SOURCEMETA_TRACE_END(trace_dispatch_id, "Dispatch"); + SOURCEMETA_TRACE_START(trace_id, "ControlEvaluate"); + const auto &control{std::get(step)}; + + if (control.report && callback.has_value()) { + // TODO: Optimize this case to avoid an extra pointer copy + auto destination = context.instance_location(); + destination.push_back(control.value); + callback.value()(EvaluationType::Pre, true, step, + context.evaluate_path(), destination, context.null); + context.evaluate(control.value); + callback.value()(EvaluationType::Post, true, step, + context.evaluate_path(), destination, context.null); + } else { + context.evaluate(control.value); + } + + SOURCEMETA_TRACE_END(trace_id, "ControlEvaluate"); return true; } @@ -700,20 +731,30 @@ auto evaluate_step(const sourcemeta::blaze::Template::value_type &step, context.instance_location().back().to_json()); } - case IS_STEP(AnnotationLoopPropertiesUnevaluated): { - EVALUATE_BEGIN(loop, AnnotationLoopPropertiesUnevaluated, - target.is_object()); + case IS_STEP(LogicalNot): { + EVALUATE_BEGIN_NO_PRECONDITION(logical, LogicalNot); + + for (const auto &child : logical.children) { + if (!evaluate_step(child, callback, context)) { + result = true; + break; + } + } + + if (logical.value) { + context.unevaluate(); + } + + EVALUATE_END(logical, LogicalNot); + } + + case IS_STEP(LoopPropertiesUnevaluated): { + EVALUATE_BEGIN(loop, LoopPropertiesUnevaluated, target.is_object()); result = true; - assert(!loop.value.empty()); for (const auto &entry : target.as_object()) { - // TODO: It might be more efficient to get all the annotations we - // potentially care about as a set first, and the make the loop - // check for O(1) containment in that set? - if (context.defines_sibling_annotation( - loop.value, - // TODO: This conversion implies a string copy - sourcemeta::jsontoolkit::JSON{entry.first})) { + if (context.is_evaluated( + sourcemeta::jsontoolkit::WeakPointer::Token{entry.first})) { continue; } @@ -730,68 +771,22 @@ auto evaluate_step(const sourcemeta::blaze::Template::value_type &step, context.leave(); } + // Mark the entire object as evaluated + context.evaluate(); + evaluate_annotation_loop_properties_unevaluated_end: - EVALUATE_END(loop, AnnotationLoopPropertiesUnevaluated); + EVALUATE_END(loop, LoopPropertiesUnevaluated); } - case IS_STEP(AnnotationLoopItemsUnmarked): { - EVALUATE_BEGIN(loop, AnnotationLoopItemsUnmarked, - target.is_array() && - !context.defines_any_annotation(loop.value)); - // Otherwise you shouldn't be using this step? - assert(!loop.value.empty()); + case IS_STEP(LoopItemsUnevaluated): { + EVALUATE_BEGIN(loop, LoopItemsUnevaluated, target.is_array()); const auto &array{target.as_array()}; result = true; - for (auto iterator = array.cbegin(); iterator != array.cend(); ++iterator) { const auto index{std::distance(array.cbegin(), iterator)}; - context.enter(static_cast(index)); - for (const auto &child : loop.children) { - if (!evaluate_step(child, callback, context)) { - result = false; - context.leave(); - goto evaluate_compiler_annotation_loop_items_unmarked_end; - } - } - - context.leave(); - } - - evaluate_compiler_annotation_loop_items_unmarked_end: - EVALUATE_END(loop, AnnotationLoopItemsUnmarked); - } - - case IS_STEP(AnnotationLoopItemsUnevaluated): { - // TODO: This precondition is very expensive due to pointer manipulation - EVALUATE_BEGIN( - loop, AnnotationLoopItemsUnevaluated, - target.is_array() && - !context.defines_sibling_annotation( - loop.value.mask, sourcemeta::jsontoolkit::JSON{true})); - const auto &array{target.as_array()}; - result = true; - auto iterator{array.cbegin()}; - - // Determine the proper start based on integer annotations collected for - // the current instance location by the keyword requested by the user. - const std::uint64_t start{ - context.largest_annotation_index(loop.value.index)}; - - // We need this check, as advancing an iterator past its bounds - // is considered undefined behavior - // See https://en.cppreference.com/w/cpp/iterator/advance - std::advance(iterator, - std::min(static_cast(start), - static_cast(target.size()))); - - for (; iterator != array.cend(); ++iterator) { - const auto index{std::distance(array.cbegin(), iterator)}; - - // TODO: Can we avoid doing this expensive operation on a loop? - if (context.defines_sibling_annotation( - loop.value.filter, sourcemeta::jsontoolkit::JSON{ - static_cast(index)})) { + if (context.is_evaluated( + static_cast(index))) { continue; } @@ -807,34 +802,11 @@ auto evaluate_step(const sourcemeta::blaze::Template::value_type &step, context.leave(); } - evaluate_compiler_annotation_loop_items_unevaluated_end: - EVALUATE_END(loop, AnnotationLoopItemsUnevaluated); - } - - case IS_STEP(AnnotationNot): { - EVALUATE_BEGIN_NO_PRECONDITION(logical, AnnotationNot); - // Ignore annotations produced inside "not" - context.mask(); - for (const auto &child : logical.children) { - if (!evaluate_step(child, callback, context)) { - result = true; - break; - } - } - - EVALUATE_END(logical, AnnotationNot); - } + // Mark the entire array as evaluated + context.evaluate(); - case IS_STEP(LogicalNot): { - EVALUATE_BEGIN_NO_PRECONDITION(logical, LogicalNot); - for (const auto &child : logical.children) { - if (!evaluate_step(child, callback, context)) { - result = true; - break; - } - } - - EVALUATE_END(logical, LogicalNot); + evaluate_compiler_annotation_loop_items_unevaluated_end: + EVALUATE_END(loop, LoopItemsUnevaluated); } case IS_STEP(LoopPropertiesMatch): { @@ -1091,7 +1063,9 @@ auto evaluate_step(const sourcemeta::blaze::Template::value_type &step, #undef EVALUATE_BEGIN_NO_TARGET #undef EVALUATE_BEGIN_TRY_TARGET #undef EVALUATE_BEGIN_NO_PRECONDITION +#undef EVALUATE_BEGIN_NO_PRECONDITION_AND_NO_PUSH #undef EVALUATE_END +#undef EVALUATE_END_NO_POP #undef EVALUATE_ANNOTATION #undef EVALUATE_ANNOTATION_NO_PRECONDITION diff --git a/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator.h b/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator.h index 00e75106..1abc4607 100644 --- a/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator.h +++ b/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator.h @@ -2,7 +2,7 @@ #define SOURCEMETA_BLAZE_EVALUATOR_H_ #ifndef SOURCEMETA_BLAZE_EVALUATOR_EXPORT -#include "evaluator_export.h" +#include #endif #include diff --git a/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator_context.h b/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator_context.h index ef14c895..f31e1edb 100644 --- a/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator_context.h +++ b/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator_context.h @@ -2,7 +2,7 @@ #define SOURCEMETA_BLAZE_EVALUATOR_CONTEXT_H #ifndef SOURCEMETA_BLAZE_EVALUATOR_EXPORT -#include "evaluator_export.h" +#include #endif #include @@ -92,26 +92,16 @@ class SOURCEMETA_BLAZE_EVALUATOR_EXPORT EvaluationContext { -> std::optional; /////////////////////////////////////////////// - // Annotations + // Evaluation /////////////////////////////////////////////// - // TODO: At least currently, we only need to mask if a schema - // makes use of `unevaluatedProperties` or `unevaluatedItems` - // Detect if a schema does need this so if not, we avoid - // an unnecessary copy - auto mask() -> void; - auto annotate( - const sourcemeta::jsontoolkit::WeakPointer ¤t_instance_location, - const sourcemeta::jsontoolkit::JSON &value) - -> std::pair, - bool>; - auto defines_any_annotation(const std::string &keyword) const -> bool; + auto evaluate() -> void; auto - defines_sibling_annotation(const std::vector &keywords, - const sourcemeta::jsontoolkit::JSON &value) const + evaluate(const sourcemeta::jsontoolkit::Pointer &relative_instance_location) + -> void; + auto is_evaluated(sourcemeta::jsontoolkit::WeakPointer::Token &&token) const -> bool; - auto largest_annotation_index(const std::string &keyword) const - -> std::uint64_t; + auto unevaluate() -> void; public: // TODO: Remove this @@ -134,12 +124,11 @@ class SOURCEMETA_BLAZE_EVALUATOR_EXPORT EvaluationContext { std::map> labels; bool property_as_instance{false}; - // For annotations - std::vector annotation_blacklist; - std::map>> - annotations_; + // TODO: Turn these into a trie + std::vector> + evaluated_; + std::vector evaluated_blacklist_; #if defined(_MSC_VER) #pragma warning(default : 4251 4275) #endif diff --git a/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator_error.h b/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator_error.h index e54aae32..640b93df 100644 --- a/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator_error.h +++ b/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator_error.h @@ -2,7 +2,7 @@ #define SOURCEMETA_BLAZE_EVALUATOR_ERROR_H #ifndef SOURCEMETA_BLAZE_EVALUATOR_EXPORT -#include "evaluator_export.h" +#include #endif #include // std::exception diff --git a/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator_template.h b/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator_template.h index 409a3b14..ae3124b6 100644 --- a/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator_template.h +++ b/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator_template.h @@ -48,10 +48,6 @@ struct AnnotationWhenArraySizeEqual; struct AnnotationWhenArraySizeGreater; struct AnnotationToParent; struct AnnotationBasenameToParent; -struct AnnotationLoopPropertiesUnevaluated; -struct AnnotationLoopItemsUnmarked; -struct AnnotationLoopItemsUnevaluated; -struct AnnotationNot; struct LogicalNot; struct LogicalOr; struct LogicalAnd; @@ -61,6 +57,8 @@ struct LogicalWhenType; struct LogicalWhenDefines; struct LogicalWhenArraySizeGreater; struct LogicalWhenArraySizeEqual; +struct LoopPropertiesUnevaluated; +struct LoopItemsUnevaluated; struct LoopPropertiesMatch; struct LoopProperties; struct LoopPropertiesRegex; @@ -72,6 +70,7 @@ struct LoopItems; struct LoopContains; struct ControlLabel; struct ControlMark; +struct ControlEvaluate; struct ControlJump; struct ControlDynamicAnchorJump; #endif @@ -90,14 +89,13 @@ using Template = std::vector>; #if !defined(DOXYGEN) @@ -138,10 +136,6 @@ enum class TemplateIndex : std::uint8_t { AnnotationWhenArraySizeGreater, AnnotationToParent, AnnotationBasenameToParent, - AnnotationLoopPropertiesUnevaluated, - AnnotationLoopItemsUnmarked, - AnnotationLoopItemsUnevaluated, - AnnotationNot, LogicalNot, LogicalOr, LogicalAnd, @@ -151,6 +145,8 @@ enum class TemplateIndex : std::uint8_t { LogicalWhenDefines, LogicalWhenArraySizeGreater, LogicalWhenArraySizeEqual, + LoopPropertiesUnevaluated, + LoopItemsUnevaluated, LoopPropertiesMatch, LoopProperties, LoopPropertiesRegex, @@ -162,6 +158,7 @@ enum class TemplateIndex : std::uint8_t { LoopContains, ControlLabel, ControlMark, + ControlEvaluate, ControlJump, ControlDynamicAnchorJump }; @@ -365,29 +362,9 @@ DEFINE_STEP_WITH_VALUE(Annotation, ToParent, ValueJSON) /// annotation to the parent DEFINE_STEP_WITH_VALUE(Annotation, BasenameToParent, ValueNone) -/// @ingroup evaluator_instructions -/// @brief Represents a compiler step that loops over object properties that -/// were not collected as annotations -DEFINE_STEP_APPLICATOR(Annotation, LoopPropertiesUnevaluated, ValueStrings) - -/// @ingroup evaluator_instructions -/// @brief Represents a compiler step that loops over array items when the array -/// is considered unmarked -DEFINE_STEP_APPLICATOR(Annotation, LoopItemsUnmarked, ValueString) - -/// @ingroup evaluator_instructions -/// @brief Represents a compiler step that loops over unevaluated array items -DEFINE_STEP_APPLICATOR(Annotation, LoopItemsUnevaluated, - ValueItemsAnnotationKeywords) - -/// @ingroup evaluator_instructions -/// @brief Represents an annotation-aware compiler logical step that represents -/// a negation -DEFINE_STEP_APPLICATOR(Annotation, Not, ValueNone) - /// @ingroup evaluator_instructions /// @brief Represents a compiler logical step that represents a negation -DEFINE_STEP_APPLICATOR(Logical, Not, ValueNone) +DEFINE_STEP_APPLICATOR(Logical, Not, ValueBoolean) /// @ingroup evaluator_instructions /// @brief Represents a compiler logical step that represents a disjunction @@ -426,6 +403,15 @@ DEFINE_STEP_APPLICATOR(Logical, WhenArraySizeGreater, ValueUnsignedInteger) /// the array instance size is equal to the given number DEFINE_STEP_APPLICATOR(Logical, WhenArraySizeEqual, ValueUnsignedInteger) +/// @ingroup evaluator_instructions +/// @brief Represents a compiler step that loops over object properties that +/// were not previously evaluated +DEFINE_STEP_APPLICATOR(Loop, PropertiesUnevaluated, ValueNone) + +/// @ingroup evaluator_instructions +/// @brief Represents a compiler step that loops over unevaluated array items +DEFINE_STEP_APPLICATOR(Loop, ItemsUnevaluated, ValueNone) + /// @ingroup evaluator_instructions /// @brief Represents a compiler step that matches steps to object properties DEFINE_STEP_APPLICATOR(Loop, PropertiesMatch, ValueNamedIndexes) @@ -478,6 +464,11 @@ DEFINE_STEP_APPLICATOR(Control, Label, ValueUnsignedInteger) /// without executing children instructions DEFINE_STEP_APPLICATOR(Control, Mark, ValueUnsignedInteger) +/// @ingroup evaluator_instructions +/// @brief Represents a compiler step that marks the current instance location +/// as evaluated +DEFINE_STEP_WITH_VALUE(Control, Evaluate, ValuePointer) + /// @ingroup evaluator_instructions /// @brief Represents a compiler step that consists of jumping into a /// pre-registered label diff --git a/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator_value.h b/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator_value.h index 31f3dc92..7c53f486 100644 --- a/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator_value.h +++ b/vendor/blaze/src/evaluator/include/sourcemeta/blaze/evaluator_value.h @@ -2,6 +2,7 @@ #define SOURCEMETA_BLAZE_EVALUATOR_VALUE_H #include +#include #include #include // std::uint8_t @@ -76,14 +77,6 @@ using ValueNamedIndexes = std::unordered_map; /// Represents a compiler step string logical type enum class ValueStringType : std::uint8_t { URI }; -/// @ingroup evaluator -/// Represents an array loop compiler step annotation keywords -struct ValueItemsAnnotationKeywords { - const ValueString index; - const ValueStrings filter; - const ValueStrings mask; -}; - /// @ingroup evaluator /// Represents an compiler step that maps strings to strings using ValueStringMap = std::unordered_map; @@ -101,6 +94,10 @@ using ValuePropertyFilter = std::pair>; /// Represents a compiler step value that consists of two indexes using ValueIndexPair = std::pair; +/// @ingroup evaluator +/// Represents a compiler step value that consists of a pointer +using ValuePointer = sourcemeta::jsontoolkit::Pointer; + } // namespace sourcemeta::blaze #endif diff --git a/vendor/blaze/vendor/noa/cmake/noa/library.cmake b/vendor/blaze/vendor/noa/cmake/noa/library.cmake index 9868714d..bc746774 100644 --- a/vendor/blaze/vendor/noa/cmake/noa/library.cmake +++ b/vendor/blaze/vendor/noa/cmake/noa/library.cmake @@ -18,6 +18,7 @@ function(noa_library) set(INCLUDE_PREFIX "include/${NOA_LIBRARY_PROJECT}") endif() + set(EXPORT_HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}_export.h") if(NOT NOA_LIBRARY_VARIANT) set(PUBLIC_HEADER "${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}.h") else() @@ -25,7 +26,7 @@ function(noa_library) endif() if(NOA_LIBRARY_SOURCES) - set(ABSOLUTE_PRIVATE_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/${NOA_LIBRARY_NAME}_export.h") + set(ABSOLUTE_PRIVATE_HEADERS "${EXPORT_HEADER_PATH}") else() set(ABSOLUTE_PRIVATE_HEADERS) endif() @@ -100,7 +101,7 @@ function(noa_library) if(NOA_LIBRARY_SOURCES) include(GenerateExportHeader) generate_export_header(${TARGET_NAME} - EXPORT_FILE_NAME ${NOA_LIBRARY_NAME}_export.h) + EXPORT_FILE_NAME ${EXPORT_HEADER_PATH}) set_target_properties(${TARGET_NAME} PROPERTIES SOVERSION "${PROJECT_VERSION_MAJOR}" @@ -108,7 +109,7 @@ function(noa_library) # To find the generated files target_include_directories(${TARGET_NAME} - PUBLIC "$") + PUBLIC "$") endif() endfunction() diff --git a/vendor/hydra/src/bucket/include/sourcemeta/hydra/bucket.h b/vendor/hydra/src/bucket/include/sourcemeta/hydra/bucket.h index a51bfbae..45cead7d 100644 --- a/vendor/hydra/src/bucket/include/sourcemeta/hydra/bucket.h +++ b/vendor/hydra/src/bucket/include/sourcemeta/hydra/bucket.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_BUCKET_H #define SOURCEMETA_HYDRA_BUCKET_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_BUCKET_EXPORT -#else -#include "bucket_export.h" +#ifndef SOURCEMETA_HYDRA_BUCKET_EXPORT +#include #endif /// @defgroup bucket Bucket diff --git a/vendor/hydra/src/bucket/include/sourcemeta/hydra/bucket_aws_sigv4.h b/vendor/hydra/src/bucket/include/sourcemeta/hydra/bucket_aws_sigv4.h index fdf1cd3b..cbb21109 100644 --- a/vendor/hydra/src/bucket/include/sourcemeta/hydra/bucket_aws_sigv4.h +++ b/vendor/hydra/src/bucket/include/sourcemeta/hydra/bucket_aws_sigv4.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_BUCKET_AWS_SIGV4_H #define SOURCEMETA_HYDRA_BUCKET_AWS_SIGV4_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_BUCKET_EXPORT -#else -#include "bucket_export.h" +#ifndef SOURCEMETA_HYDRA_BUCKET_EXPORT +#include #endif #include diff --git a/vendor/hydra/src/bucket/include/sourcemeta/hydra/bucket_error.h b/vendor/hydra/src/bucket/include/sourcemeta/hydra/bucket_error.h index 6d6ae24e..4631194b 100644 --- a/vendor/hydra/src/bucket/include/sourcemeta/hydra/bucket_error.h +++ b/vendor/hydra/src/bucket/include/sourcemeta/hydra/bucket_error.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_BUCKET_ERROR_H #define SOURCEMETA_HYDRA_BUCKET_ERROR_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_BUCKET_EXPORT -#else -#include "bucket_export.h" +#ifndef SOURCEMETA_HYDRA_BUCKET_EXPORT +#include #endif #include // std::exception diff --git a/vendor/hydra/src/crypto/include/sourcemeta/hydra/crypto.h b/vendor/hydra/src/crypto/include/sourcemeta/hydra/crypto.h index f87fbfce..a559088e 100644 --- a/vendor/hydra/src/crypto/include/sourcemeta/hydra/crypto.h +++ b/vendor/hydra/src/crypto/include/sourcemeta/hydra/crypto.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_CRYPTO_H #define SOURCEMETA_HYDRA_CRYPTO_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_CRYPTO_EXPORT -#else -#include "crypto_export.h" +#ifndef SOURCEMETA_HYDRA_CRYPTO_EXPORT +#include #endif #include // std::ostream diff --git a/vendor/hydra/src/http/include/sourcemeta/hydra/http_error.h b/vendor/hydra/src/http/include/sourcemeta/hydra/http_error.h index 02309c9b..778ae1d4 100644 --- a/vendor/hydra/src/http/include/sourcemeta/hydra/http_error.h +++ b/vendor/hydra/src/http/include/sourcemeta/hydra/http_error.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_HTTP_ERROR_H #define SOURCEMETA_HYDRA_HTTP_ERROR_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_HTTP_EXPORT -#else -#include "http_export.h" +#ifndef SOURCEMETA_HYDRA_HTTP_EXPORT +#include #endif #include // std::exception diff --git a/vendor/hydra/src/http/include/sourcemeta/hydra/http_header.h b/vendor/hydra/src/http/include/sourcemeta/hydra/http_header.h index 39ee1367..18b86ee7 100644 --- a/vendor/hydra/src/http/include/sourcemeta/hydra/http_header.h +++ b/vendor/hydra/src/http/include/sourcemeta/hydra/http_header.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_HTTP_HEADER_H #define SOURCEMETA_HYDRA_HTTP_HEADER_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_HTTP_EXPORT -#else -#include "http_export.h" +#ifndef SOURCEMETA_HYDRA_HTTP_EXPORT +#include #endif #include // std::chrono::system_clock::time_point diff --git a/vendor/hydra/src/http/include/sourcemeta/hydra/http_method.h b/vendor/hydra/src/http/include/sourcemeta/hydra/http_method.h index 76641914..82dc1737 100644 --- a/vendor/hydra/src/http/include/sourcemeta/hydra/http_method.h +++ b/vendor/hydra/src/http/include/sourcemeta/hydra/http_method.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_HTTP_METHOD_H #define SOURCEMETA_HYDRA_HTTP_METHOD_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_HTTP_EXPORT -#else -#include "http_export.h" +#ifndef SOURCEMETA_HYDRA_HTTP_EXPORT +#include #endif #include // std::ostream diff --git a/vendor/hydra/src/http/include/sourcemeta/hydra/http_mime.h b/vendor/hydra/src/http/include/sourcemeta/hydra/http_mime.h index ac3233a6..febeaba2 100644 --- a/vendor/hydra/src/http/include/sourcemeta/hydra/http_mime.h +++ b/vendor/hydra/src/http/include/sourcemeta/hydra/http_mime.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_HTTP_MIME_H #define SOURCEMETA_HYDRA_HTTP_MIME_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_HTTP_EXPORT -#else -#include "http_export.h" +#ifndef SOURCEMETA_HYDRA_HTTP_EXPORT +#include #endif #include // std::filesystem diff --git a/vendor/hydra/src/http/include/sourcemeta/hydra/http_status.h b/vendor/hydra/src/http/include/sourcemeta/hydra/http_status.h index 928cbae4..acc40d2d 100644 --- a/vendor/hydra/src/http/include/sourcemeta/hydra/http_status.h +++ b/vendor/hydra/src/http/include/sourcemeta/hydra/http_status.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_HTTP_STATUS_H #define SOURCEMETA_HYDRA_HTTP_STATUS_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_HTTP_EXPORT -#else -#include "http_export.h" +#ifndef SOURCEMETA_HYDRA_HTTP_EXPORT +#include #endif #include // std::uint16_t diff --git a/vendor/hydra/src/http/include/sourcemeta/hydra/http_time.h b/vendor/hydra/src/http/include/sourcemeta/hydra/http_time.h index c8774654..bff2dc11 100644 --- a/vendor/hydra/src/http/include/sourcemeta/hydra/http_time.h +++ b/vendor/hydra/src/http/include/sourcemeta/hydra/http_time.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_HTTP_TIME_H #define SOURCEMETA_HYDRA_HTTP_TIME_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_HTTP_EXPORT -#else -#include "http_export.h" +#ifndef SOURCEMETA_HYDRA_HTTP_EXPORT +#include #endif #include // std::chrono::system_clock::time_point diff --git a/vendor/hydra/src/httpclient/include/sourcemeta/hydra/httpclient_request.h b/vendor/hydra/src/httpclient/include/sourcemeta/hydra/httpclient_request.h index 5c78c5df..5af46fa8 100644 --- a/vendor/hydra/src/httpclient/include/sourcemeta/hydra/httpclient_request.h +++ b/vendor/hydra/src/httpclient/include/sourcemeta/hydra/httpclient_request.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_HTTPCLIENT_REQUEST_H #define SOURCEMETA_HYDRA_HTTPCLIENT_REQUEST_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_HTTPCLIENT_EXPORT -#else -#include "httpclient_export.h" +#ifndef SOURCEMETA_HYDRA_HTTPCLIENT_EXPORT +#include #endif #include diff --git a/vendor/hydra/src/httpclient/include/sourcemeta/hydra/httpclient_response.h b/vendor/hydra/src/httpclient/include/sourcemeta/hydra/httpclient_response.h index 65210d21..d9bd00c5 100644 --- a/vendor/hydra/src/httpclient/include/sourcemeta/hydra/httpclient_response.h +++ b/vendor/hydra/src/httpclient/include/sourcemeta/hydra/httpclient_response.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_HTTPCLIENT_RESPONSE_H #define SOURCEMETA_HYDRA_HTTPCLIENT_RESPONSE_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_HTTPCLIENT_EXPORT -#else -#include "httpclient_export.h" +#ifndef SOURCEMETA_HYDRA_HTTPCLIENT_EXPORT +#include #endif #include diff --git a/vendor/hydra/src/httpclient/include/sourcemeta/hydra/httpclient_stream.h b/vendor/hydra/src/httpclient/include/sourcemeta/hydra/httpclient_stream.h index 648b55f3..915047e4 100644 --- a/vendor/hydra/src/httpclient/include/sourcemeta/hydra/httpclient_stream.h +++ b/vendor/hydra/src/httpclient/include/sourcemeta/hydra/httpclient_stream.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_HTTPCLIENT_STREAM_H #define SOURCEMETA_HYDRA_HTTPCLIENT_STREAM_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_HTTPCLIENT_EXPORT -#else -#include "httpclient_export.h" +#ifndef SOURCEMETA_HYDRA_HTTPCLIENT_EXPORT +#include #endif #include diff --git a/vendor/hydra/src/httpserver/include/sourcemeta/hydra/httpserver.h b/vendor/hydra/src/httpserver/include/sourcemeta/hydra/httpserver.h index 129fe21c..3a1a424a 100644 --- a/vendor/hydra/src/httpserver/include/sourcemeta/hydra/httpserver.h +++ b/vendor/hydra/src/httpserver/include/sourcemeta/hydra/httpserver.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_HTTPSERVER_H #define SOURCEMETA_HYDRA_HTTPSERVER_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_HTTPSERVER_EXPORT -#else -#include "httpserver_export.h" +#ifndef SOURCEMETA_HYDRA_HTTPSERVER_EXPORT +#include #endif /// @defgroup httpserver HTTP Server diff --git a/vendor/hydra/src/httpserver/include/sourcemeta/hydra/httpserver_logger.h b/vendor/hydra/src/httpserver/include/sourcemeta/hydra/httpserver_logger.h index ea8c9fe7..60347fb7 100644 --- a/vendor/hydra/src/httpserver/include/sourcemeta/hydra/httpserver_logger.h +++ b/vendor/hydra/src/httpserver/include/sourcemeta/hydra/httpserver_logger.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_HTTPSERVER_LOGGER_H #define SOURCEMETA_HYDRA_HTTPSERVER_LOGGER_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_HTTPSERVER_EXPORT -#else -#include "httpserver_export.h" +#ifndef SOURCEMETA_HYDRA_HTTPSERVER_EXPORT +#include #endif #include // std::string diff --git a/vendor/hydra/src/httpserver/include/sourcemeta/hydra/httpserver_request.h b/vendor/hydra/src/httpserver/include/sourcemeta/hydra/httpserver_request.h index d8e9337a..3a212719 100644 --- a/vendor/hydra/src/httpserver/include/sourcemeta/hydra/httpserver_request.h +++ b/vendor/hydra/src/httpserver/include/sourcemeta/hydra/httpserver_request.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_HTTPSERVER_REQUEST_H #define SOURCEMETA_HYDRA_HTTPSERVER_REQUEST_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_HTTPSERVER_EXPORT -#else -#include "httpserver_export.h" +#ifndef SOURCEMETA_HYDRA_HTTPSERVER_EXPORT +#include #endif #include diff --git a/vendor/hydra/src/httpserver/include/sourcemeta/hydra/httpserver_response.h b/vendor/hydra/src/httpserver/include/sourcemeta/hydra/httpserver_response.h index b12a6374..72c7c355 100644 --- a/vendor/hydra/src/httpserver/include/sourcemeta/hydra/httpserver_response.h +++ b/vendor/hydra/src/httpserver/include/sourcemeta/hydra/httpserver_response.h @@ -1,10 +1,8 @@ #ifndef SOURCEMETA_HYDRA_HTTPSERVER_RESPONSE_H #define SOURCEMETA_HYDRA_HTTPSERVER_RESPONSE_H -#if defined(__Unikraft__) -#define SOURCEMETA_HYDRA_HTTPSERVER_EXPORT -#else -#include "httpserver_export.h" +#ifndef SOURCEMETA_HYDRA_HTTPSERVER_EXPORT +#include #endif #include diff --git a/vendor/hydra/vendor/noa/cmake/noa/library.cmake b/vendor/hydra/vendor/noa/cmake/noa/library.cmake index 9868714d..bc746774 100644 --- a/vendor/hydra/vendor/noa/cmake/noa/library.cmake +++ b/vendor/hydra/vendor/noa/cmake/noa/library.cmake @@ -18,6 +18,7 @@ function(noa_library) set(INCLUDE_PREFIX "include/${NOA_LIBRARY_PROJECT}") endif() + set(EXPORT_HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}_export.h") if(NOT NOA_LIBRARY_VARIANT) set(PUBLIC_HEADER "${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}.h") else() @@ -25,7 +26,7 @@ function(noa_library) endif() if(NOA_LIBRARY_SOURCES) - set(ABSOLUTE_PRIVATE_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/${NOA_LIBRARY_NAME}_export.h") + set(ABSOLUTE_PRIVATE_HEADERS "${EXPORT_HEADER_PATH}") else() set(ABSOLUTE_PRIVATE_HEADERS) endif() @@ -100,7 +101,7 @@ function(noa_library) if(NOA_LIBRARY_SOURCES) include(GenerateExportHeader) generate_export_header(${TARGET_NAME} - EXPORT_FILE_NAME ${NOA_LIBRARY_NAME}_export.h) + EXPORT_FILE_NAME ${EXPORT_HEADER_PATH}) set_target_properties(${TARGET_NAME} PROPERTIES SOVERSION "${PROJECT_VERSION_MAJOR}" @@ -108,7 +109,7 @@ function(noa_library) # To find the generated files target_include_directories(${TARGET_NAME} - PUBLIC "$") + PUBLIC "$") endif() endfunction() diff --git a/vendor/jsonbinpack/src/compiler/include/sourcemeta/jsonbinpack/compiler.h b/vendor/jsonbinpack/src/compiler/include/sourcemeta/jsonbinpack/compiler.h index 5d1ca275..e06b9683 100644 --- a/vendor/jsonbinpack/src/compiler/include/sourcemeta/jsonbinpack/compiler.h +++ b/vendor/jsonbinpack/src/compiler/include/sourcemeta/jsonbinpack/compiler.h @@ -1,7 +1,9 @@ #ifndef SOURCEMETA_JSONBINPACK_COMPILER_H_ #define SOURCEMETA_JSONBINPACK_COMPILER_H_ -#include "compiler_export.h" +#ifndef SOURCEMETA_JSONBINPACK_COMPILER_EXPORT +#include +#endif /// @defgroup compiler Compiler /// @brief The built-time schema compiler of JSON BinPack diff --git a/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime.h b/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime.h index 63d46664..24dcd001 100644 --- a/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime.h +++ b/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime.h @@ -10,7 +10,9 @@ /// #include /// ``` -#include "runtime_export.h" +#ifndef SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT +#include +#endif #include diff --git a/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_decoder.h b/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_decoder.h index 4f1fc4c0..cc65efae 100644 --- a/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_decoder.h +++ b/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_decoder.h @@ -1,7 +1,9 @@ #ifndef SOURCEMETA_JSONBINPACK_RUNTIME_DECODER_H_ #define SOURCEMETA_JSONBINPACK_RUNTIME_DECODER_H_ -#include "runtime_export.h" +#ifndef SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT +#include +#endif #include #include diff --git a/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_encoder.h b/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_encoder.h index b1ecde9d..5bd469a1 100644 --- a/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_encoder.h +++ b/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_encoder.h @@ -1,7 +1,9 @@ #ifndef SOURCEMETA_JSONBINPACK_RUNTIME_ENCODER_H_ #define SOURCEMETA_JSONBINPACK_RUNTIME_ENCODER_H_ -#include "runtime_export.h" +#ifndef SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT +#include +#endif #include #include diff --git a/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_encoder_cache.h b/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_encoder_cache.h index 7d730bc2..8740761d 100644 --- a/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_encoder_cache.h +++ b/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_encoder_cache.h @@ -2,7 +2,9 @@ #define SOURCEMETA_JSONBINPACK_RUNTIME_ENCODER_CACHE_H_ #ifndef DOXYGEN -#include "runtime_export.h" +#ifndef SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT +#include +#endif #include diff --git a/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_input_stream.h b/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_input_stream.h index dc95f2ba..466ddea9 100644 --- a/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_input_stream.h +++ b/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_input_stream.h @@ -1,7 +1,9 @@ #ifndef SOURCEMETA_JSONBINPACK_RUNTIME_INPUT_STREAM_H_ #define SOURCEMETA_JSONBINPACK_RUNTIME_INPUT_STREAM_H_ -#include "runtime_export.h" +#ifndef SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT +#include +#endif #include diff --git a/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_output_stream.h b/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_output_stream.h index fe58681a..7eff978c 100644 --- a/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_output_stream.h +++ b/vendor/jsonbinpack/src/runtime/include/sourcemeta/jsonbinpack/runtime_output_stream.h @@ -1,7 +1,9 @@ #ifndef SOURCEMETA_JSONBINPACK_RUNTIME_OUTPUT_STREAM_H_ #define SOURCEMETA_JSONBINPACK_RUNTIME_OUTPUT_STREAM_H_ -#include "runtime_export.h" +#ifndef SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT +#include +#endif #include diff --git a/vendor/jsonbinpack/vendor/noa/cmake/noa/library.cmake b/vendor/jsonbinpack/vendor/noa/cmake/noa/library.cmake index 9868714d..bc746774 100644 --- a/vendor/jsonbinpack/vendor/noa/cmake/noa/library.cmake +++ b/vendor/jsonbinpack/vendor/noa/cmake/noa/library.cmake @@ -18,6 +18,7 @@ function(noa_library) set(INCLUDE_PREFIX "include/${NOA_LIBRARY_PROJECT}") endif() + set(EXPORT_HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}_export.h") if(NOT NOA_LIBRARY_VARIANT) set(PUBLIC_HEADER "${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}.h") else() @@ -25,7 +26,7 @@ function(noa_library) endif() if(NOA_LIBRARY_SOURCES) - set(ABSOLUTE_PRIVATE_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/${NOA_LIBRARY_NAME}_export.h") + set(ABSOLUTE_PRIVATE_HEADERS "${EXPORT_HEADER_PATH}") else() set(ABSOLUTE_PRIVATE_HEADERS) endif() @@ -100,7 +101,7 @@ function(noa_library) if(NOA_LIBRARY_SOURCES) include(GenerateExportHeader) generate_export_header(${TARGET_NAME} - EXPORT_FILE_NAME ${NOA_LIBRARY_NAME}_export.h) + EXPORT_FILE_NAME ${EXPORT_HEADER_PATH}) set_target_properties(${TARGET_NAME} PROPERTIES SOVERSION "${PROJECT_VERSION_MAJOR}" @@ -108,7 +109,7 @@ function(noa_library) # To find the generated files target_include_directories(${TARGET_NAME} - PUBLIC "$") + PUBLIC "$") endif() endfunction() diff --git a/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json.h b/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json.h index 88224e69..18c589ef 100644 --- a/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json.h +++ b/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json.h @@ -2,7 +2,7 @@ #define SOURCEMETA_JSONTOOLKIT_JSON_H_ #ifndef SOURCEMETA_JSONTOOLKIT_JSON_EXPORT -#include "json_export.h" +#include #endif #include diff --git a/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_error.h b/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_error.h index 4e9b341a..eb7e90c6 100644 --- a/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_error.h +++ b/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_error.h @@ -2,7 +2,7 @@ #define SOURCEMETA_JSONTOOLKIT_JSON_ERROR_H_ #ifndef SOURCEMETA_JSONTOOLKIT_JSON_EXPORT -#include "json_export.h" +#include #endif #include // std::uint64_t 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 005561f7..a5e9fb92 100644 --- a/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_value.h +++ b/vendor/jsontoolkit/src/json/include/sourcemeta/jsontoolkit/json_value.h @@ -2,7 +2,7 @@ #define SOURCEMETA_JSONTOOLKIT_JSON_VALUE_H_ #ifndef SOURCEMETA_JSONTOOLKIT_JSON_EXPORT -#include "json_export.h" +#include #endif #include diff --git a/vendor/jsontoolkit/src/jsonl/include/sourcemeta/jsontoolkit/jsonl.h b/vendor/jsontoolkit/src/jsonl/include/sourcemeta/jsontoolkit/jsonl.h index 813210f8..d54a60e4 100644 --- a/vendor/jsontoolkit/src/jsonl/include/sourcemeta/jsontoolkit/jsonl.h +++ b/vendor/jsontoolkit/src/jsonl/include/sourcemeta/jsontoolkit/jsonl.h @@ -2,7 +2,7 @@ #define SOURCEMETA_JSONTOOLKIT_JSONL_H_ #ifndef SOURCEMETA_JSONTOOLKIT_JSONL_EXPORT -#include "jsonl_export.h" +#include #endif #include diff --git a/vendor/jsontoolkit/src/jsonl/include/sourcemeta/jsontoolkit/jsonl_iterator.h b/vendor/jsontoolkit/src/jsonl/include/sourcemeta/jsontoolkit/jsonl_iterator.h index 6e2d31b7..41ef4ab2 100644 --- a/vendor/jsontoolkit/src/jsonl/include/sourcemeta/jsontoolkit/jsonl_iterator.h +++ b/vendor/jsontoolkit/src/jsonl/include/sourcemeta/jsontoolkit/jsonl_iterator.h @@ -2,7 +2,7 @@ #define SOURCEMETA_JSONTOOLKIT_JSONL_ITERATOR_H_ #ifndef SOURCEMETA_JSONTOOLKIT_JSONL_EXPORT -#include "jsonl_export.h" +#include #endif #include diff --git a/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer.h b/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer.h index 2cd68d9a..c79eebea 100644 --- a/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer.h +++ b/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer.h @@ -2,7 +2,7 @@ #define SOURCEMETA_JSONTOOLKIT_JSONPOINTER_H_ #ifndef SOURCEMETA_JSONTOOLKIT_JSONPOINTER_EXPORT -#include "jsonpointer_export.h" +#include #endif #include diff --git a/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer_error.h b/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer_error.h index 71b08a12..29b9812f 100644 --- a/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer_error.h +++ b/vendor/jsontoolkit/src/jsonpointer/include/sourcemeta/jsontoolkit/jsonpointer_error.h @@ -2,7 +2,7 @@ #define SOURCEMETA_JSONTOOLKIT_JSONPOINTER_ERROR_H_ #ifndef SOURCEMETA_JSONTOOLKIT_JSONPOINTER_EXPORT -#include "jsonpointer_export.h" +#include #endif #include diff --git a/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema.h b/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema.h index 54e0d9fe..9a981943 100644 --- a/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema.h +++ b/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema.h @@ -2,7 +2,7 @@ #define SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_H_ #ifndef SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_EXPORT -#include "jsonschema_export.h" +#include #endif #include diff --git a/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_anchor.h b/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_anchor.h index a55d0c7c..aaf565bd 100644 --- a/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_anchor.h +++ b/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_anchor.h @@ -2,7 +2,7 @@ #define SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_ANCHOR_H_ #ifndef SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_EXPORT -#include "jsonschema_export.h" +#include #endif #include diff --git a/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_bundle.h b/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_bundle.h index bacca953..345510bc 100644 --- a/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_bundle.h +++ b/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_bundle.h @@ -2,7 +2,7 @@ #define SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_BUNDLE_H_ #ifndef SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_EXPORT -#include "jsonschema_export.h" +#include #endif #include diff --git a/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_error.h b/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_error.h index 887563f5..a2ca383a 100644 --- a/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_error.h +++ b/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_error.h @@ -2,7 +2,7 @@ #define SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_ERROR_H #ifndef SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_EXPORT -#include "jsonschema_export.h" +#include #endif #include diff --git a/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_reference.h b/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_reference.h index 3f4ff6af..4eac5268 100644 --- a/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_reference.h +++ b/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_reference.h @@ -2,7 +2,7 @@ #define SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_REFERENCE_H_ #ifndef SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_EXPORT -#include "jsonschema_export.h" +#include #endif #include diff --git a/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_resolver.h b/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_resolver.h index d1cb51d8..9bd3cd09 100644 --- a/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_resolver.h +++ b/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_resolver.h @@ -2,7 +2,7 @@ #define SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_RESOLVER_H_ #ifndef SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_EXPORT -#include "jsonschema_export.h" +#include #endif #include diff --git a/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_walker.h b/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_walker.h index 625a7f82..e271a41f 100644 --- a/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_walker.h +++ b/vendor/jsontoolkit/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_walker.h @@ -2,7 +2,7 @@ #define SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_WALKER_H_ #ifndef SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_EXPORT -#include "jsonschema_export.h" +#include #endif #include diff --git a/vendor/jsontoolkit/src/uri/include/sourcemeta/jsontoolkit/uri.h b/vendor/jsontoolkit/src/uri/include/sourcemeta/jsontoolkit/uri.h index b9ee2d4c..c698abfd 100644 --- a/vendor/jsontoolkit/src/uri/include/sourcemeta/jsontoolkit/uri.h +++ b/vendor/jsontoolkit/src/uri/include/sourcemeta/jsontoolkit/uri.h @@ -2,7 +2,7 @@ #define SOURCEMETA_JSONTOOLKIT_URI_H_ #ifndef SOURCEMETA_JSONTOOLKIT_URI_EXPORT -#include "uri_export.h" +#include #endif #include diff --git a/vendor/jsontoolkit/src/uri/include/sourcemeta/jsontoolkit/uri_error.h b/vendor/jsontoolkit/src/uri/include/sourcemeta/jsontoolkit/uri_error.h index 8062f450..d0313870 100644 --- a/vendor/jsontoolkit/src/uri/include/sourcemeta/jsontoolkit/uri_error.h +++ b/vendor/jsontoolkit/src/uri/include/sourcemeta/jsontoolkit/uri_error.h @@ -2,7 +2,7 @@ #define SOURCEMETA_JSONTOOLKIT_URI_ERROR_H_ #ifndef SOURCEMETA_JSONTOOLKIT_URI_EXPORT -#include "uri_export.h" +#include #endif #include // std::uint64_t diff --git a/vendor/jsontoolkit/vendor/noa/cmake/noa/library.cmake b/vendor/jsontoolkit/vendor/noa/cmake/noa/library.cmake index 9868714d..bc746774 100644 --- a/vendor/jsontoolkit/vendor/noa/cmake/noa/library.cmake +++ b/vendor/jsontoolkit/vendor/noa/cmake/noa/library.cmake @@ -18,6 +18,7 @@ function(noa_library) set(INCLUDE_PREFIX "include/${NOA_LIBRARY_PROJECT}") endif() + set(EXPORT_HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}_export.h") if(NOT NOA_LIBRARY_VARIANT) set(PUBLIC_HEADER "${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}.h") else() @@ -25,7 +26,7 @@ function(noa_library) endif() if(NOA_LIBRARY_SOURCES) - set(ABSOLUTE_PRIVATE_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/${NOA_LIBRARY_NAME}_export.h") + set(ABSOLUTE_PRIVATE_HEADERS "${EXPORT_HEADER_PATH}") else() set(ABSOLUTE_PRIVATE_HEADERS) endif() @@ -100,7 +101,7 @@ function(noa_library) if(NOA_LIBRARY_SOURCES) include(GenerateExportHeader) generate_export_header(${TARGET_NAME} - EXPORT_FILE_NAME ${NOA_LIBRARY_NAME}_export.h) + EXPORT_FILE_NAME ${EXPORT_HEADER_PATH}) set_target_properties(${TARGET_NAME} PROPERTIES SOVERSION "${PROJECT_VERSION_MAJOR}" @@ -108,7 +109,7 @@ function(noa_library) # To find the generated files target_include_directories(${TARGET_NAME} - PUBLIC "$") + PUBLIC "$") endif() endfunction() diff --git a/vendor/noa/cmake/noa/library.cmake b/vendor/noa/cmake/noa/library.cmake index 9868714d..bc746774 100644 --- a/vendor/noa/cmake/noa/library.cmake +++ b/vendor/noa/cmake/noa/library.cmake @@ -18,6 +18,7 @@ function(noa_library) set(INCLUDE_PREFIX "include/${NOA_LIBRARY_PROJECT}") endif() + set(EXPORT_HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}_export.h") if(NOT NOA_LIBRARY_VARIANT) set(PUBLIC_HEADER "${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}.h") else() @@ -25,7 +26,7 @@ function(noa_library) endif() if(NOA_LIBRARY_SOURCES) - set(ABSOLUTE_PRIVATE_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/${NOA_LIBRARY_NAME}_export.h") + set(ABSOLUTE_PRIVATE_HEADERS "${EXPORT_HEADER_PATH}") else() set(ABSOLUTE_PRIVATE_HEADERS) endif() @@ -100,7 +101,7 @@ function(noa_library) if(NOA_LIBRARY_SOURCES) include(GenerateExportHeader) generate_export_header(${TARGET_NAME} - EXPORT_FILE_NAME ${NOA_LIBRARY_NAME}_export.h) + EXPORT_FILE_NAME ${EXPORT_HEADER_PATH}) set_target_properties(${TARGET_NAME} PROPERTIES SOVERSION "${PROJECT_VERSION_MAJOR}" @@ -108,7 +109,7 @@ function(noa_library) # To find the generated files target_include_directories(${TARGET_NAME} - PUBLIC "$") + PUBLIC "$") endif() endfunction()