#ifndef MALACHSCRIPT_DIAGNOSTIC_HPP #define MALACHSCRIPT_DIAGNOSTIC_HPP #include "../TextSpan.hpp" #include "DiagnosticLevel.hpp" #include "DiagnosticType.hpp" namespace MalachScript::Diagnostics { class Diagnostic { DiagnosticLevel _level; DiagnosticType _type; std::string_view _scriptName; TextSpan _span; std::vector _formats; public: inline Diagnostic(DiagnosticLevel level, DiagnosticType type, const std::string_view& scriptName, TextSpan span, const std::vector& formats = {}) : _level(level), _type(type), _scriptName(scriptName), _span(span), _formats(formats) {} [[nodiscard]] inline DiagnosticLevel GetLevel() const noexcept { return _level; } [[nodiscard]] inline DiagnosticType GetType() const noexcept { return _type; } [[nodiscard]] inline const TextSpan& GetSpan() const noexcept { return _span; } [[nodiscard]] inline const std::string_view& GetScriptName() const noexcept { return _scriptName; } [[nodiscard]] inline const std::vector& GetFormats() const noexcept { return _formats; } }; } #endif // MALACHSCRIPT_DIAGNOSTIC_HPP