File tree Expand file tree Collapse file tree 4 files changed +22
-9
lines changed
Expand file tree Collapse file tree 4 files changed +22
-9
lines changed Original file line number Diff line number Diff line change 55#include < utility> // std::move
66#include < variant> // std::visit
77
8- static auto step_name (const sourcemeta::blaze::Instruction &instruction)
9- -> std::string_view {
10- return sourcemeta::blaze::InstructionNames
11- [static_cast <std::underlying_type_t <sourcemeta::blaze::InstructionIndex>>(
12- instruction.type )];
13- }
14-
158static auto try_vocabulary (
169 const std::optional<
1710 std::reference_wrapper<const sourcemeta::core::SchemaFrame>> &frame,
@@ -64,7 +57,7 @@ auto TraceOutput::operator()(
6457 const sourcemeta::core::WeakPointer &instance_location,
6558 const sourcemeta::core::JSON &annotation) -> void {
6659
67- const auto short_step_name{step_name ( step)};
60+ const auto short_step_name{step. name ( )};
6861 auto effective_evaluate_path{evaluate_path.resolve_from (this ->base_ )};
6962
7063 // Attempt to get vocabulary information if we can get it
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ sourcemeta_library(NAMESPACE sourcemeta PROJECT blaze NAME evaluator
22 FOLDER "Blaze/Evaluator"
33 PRIVATE_HEADERS error.h value .h instruction.h string_set.h
44 SOURCES evaluator.cc dispatch.inc.h
5- evaluator_string_set.cc
5+ evaluator_string_set.cc evaluator_instruction.cc
66 evaluator_complete.h evaluator_dynamic.h
77 evaluator_track.h evaluator_fast.h)
88
Original file line number Diff line number Diff line change 1+ #include < sourcemeta/blaze/evaluator_instruction.h>
2+
3+ #include < type_traits> // std::underlying_type_t
4+
5+ namespace sourcemeta ::blaze {
6+
7+ auto Instruction::name () const -> std::string_view {
8+ return InstructionNames[static_cast <std::underlying_type_t <InstructionIndex>>(
9+ this ->type )];
10+ }
11+
12+ } // namespace sourcemeta::blaze
Original file line number Diff line number Diff line change 11#ifndef SOURCEMETA_BLAZE_EVALUATOR_TEMPLATE_H
22#define SOURCEMETA_BLAZE_EVALUATOR_TEMPLATE_H
33
4+ #ifndef SOURCEMETA_BLAZE_EVALUATOR_EXPORT
5+ #include < sourcemeta/blaze/evaluator_export.h>
6+ #endif
7+
48#include < sourcemeta/blaze/evaluator_value.h>
59
610#include < sourcemeta/core/jsonpointer.h>
@@ -245,6 +249,10 @@ struct Instruction {
245249 const std::size_t schema_resource;
246250 const Value value;
247251 const Instructions children;
252+
253+ // / Get the name of the instruction as a string
254+ SOURCEMETA_BLAZE_EVALUATOR_EXPORT
255+ auto name () const -> std::string_view;
248256};
249257
250258} // namespace sourcemeta::blaze
You can’t perform that action at this time.
0 commit comments