#include "AST/Def.h" namespace plsm { boost::json::value ast::ValDecl::toJson() { return { {"@type", "ValDecl"}, {"name", name}, {"type", type->toJson()}, {"value", value->toJson()}, }; } std::unique_ptr ast::ValDecl::fromJson(boost::json::value json) { auto name = getJsonValue(json, "name"); auto type = fromJsonProperty(json, "type"); auto value = fromJsonProperty(json, "value"); return std::make_unique(ast::Location::json(), name, type, value); } } // namespace plsm