Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function(configure_jsonnet_obj_target LIB_TARGET_NAME)
else()
target_sources(${LIB_TARGET_NAME}
PRIVATE
third_party/rapidyaml/rapidyaml-0.10.0.hpp
third_party/rapidyaml/rapidyaml-0.11.1.hpp
third_party/rapidyaml/rapidyaml.cpp
)
endif()
Expand Down
22 changes: 11 additions & 11 deletions core/vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ limitations under the License.
#ifdef USE_SYSTEM_RAPIDYAML
#include <ryml.hpp>
#else
#include "rapidyaml-0.10.0.hpp"
#include "rapidyaml-0.11.1.hpp"
#endif
#include "state.h"
#include "static_analysis.h"
Expand Down Expand Up @@ -1715,9 +1715,9 @@ class Interpreter {
json j;
try {
// Use a custom EventHandler so we can attach error handling.
ryml::EventHandlerTree et{ryml::Callbacks{
nullptr, nullptr, nullptr, &Interpreter::handleRapidYamlError
}};
ryml::Callbacks cb;
cb.set_error_basic(&Interpreter::handleRapidYamlError);
ryml::EventHandlerTree et{cb};
ryml::Parser pe(&et);
ryml::Tree tree = ryml::parse_in_arena(&pe, ryml::to_csubstr(value));

Expand Down Expand Up @@ -3473,16 +3473,16 @@ class Interpreter {
return r;
}

static void handleRapidYamlError(const char* inner_msg, size_t length, ryml::Location loc, void * /* unused: userdata */)
static void handleRapidYamlError(ryml::csubstr inner_msg, ryml::ErrorDataBasic const& errdata, void * /* unused: user_data */)
{
std::ostringstream msg;
msg << "YAML error: " << loc.line << ":";
if (loc.col) {
msg << loc.col << ":";
} else if (loc.offset) {
msg << loc.offset << ":";
msg << "YAML error: " << errdata.location.line << ":";
if (errdata.location.col) {
msg << errdata.location.col << ":";
} else if (errdata.location.offset) {
msg << errdata.location.offset << ":";
}
msg << " " << std::string_view(inner_msg, length);
msg << " " << inner_msg;
throw RapidYamlError(msg.str());
}
};
Expand Down
2 changes: 1 addition & 1 deletion third_party/rapidyaml/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cc_library(
"rapidyaml.cpp",
],
hdrs = [
"rapidyaml-0.10.0.hpp",
"rapidyaml-0.11.1.hpp",
],
includes = ["."],
visibility = ["//core:__pkg__"],
Expand Down
4 changes: 2 additions & 2 deletions third_party/rapidyaml/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Vendoring

This uses the 'single header' release of Rapid YAML.
Download from: https://github.com/biojppm/rapidyaml/releases/tag/v0.10.0
Download from: https://github.com/biojppm/rapidyaml/releases/tag/v0.11.1

`rapidyaml-0.10.0.hpp
`rapidyaml-0.11.1.hpp

rapidyaml.cpp instantiates the library as a single translation unit.
Loading
Loading