Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
34 lines
887 B
C++
34 lines
887 B
C++
#pragma once
|
|
|
|
#include <mln/style/expression/expression.hpp>
|
|
|
|
#include <string>
|
|
|
|
namespace mln {
|
|
namespace style {
|
|
namespace expression {
|
|
|
|
class Error : public Expression {
|
|
public:
|
|
Error(std::string message_)
|
|
: Expression(Kind::Error, type::Error, Dependency::None),
|
|
message(std::move(message_)) {}
|
|
|
|
void eachChild(const std::function<void(const Expression&)>&) const override {}
|
|
|
|
bool operator==(const Expression& e) const noexcept override { return e.getKind() == Kind::Error; }
|
|
|
|
EvaluationResult evaluate(const EvaluationContext&) const override { return EvaluationError{message}; }
|
|
|
|
std::vector<std::optional<Value>> possibleOutputs() const noexcept override { return {}; }
|
|
|
|
std::string getOperator() const override { return "error"; }
|
|
|
|
private:
|
|
std::string message;
|
|
};
|
|
|
|
} // namespace expression
|
|
} // namespace style
|
|
} // namespace mln
|