31 lines
699 B
C++
31 lines
699 B
C++
#pragma once
|
|
|
|
#include "fesa/core/source_identity.hpp"
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace fesa {
|
|
|
|
// Distinguishes recoverable warnings from errors that stop the current operation.
|
|
enum class Severity {
|
|
warning,
|
|
error
|
|
};
|
|
|
|
// Carries a structured, backend-independent diagnostic record.
|
|
struct Diagnostic {
|
|
Severity severity;
|
|
std::string code;
|
|
SourceLocation location;
|
|
std::string keyword;
|
|
std::string entityIdentity;
|
|
std::string message;
|
|
};
|
|
|
|
// Orders diagnostics by their externally visible source tuple while retaining
|
|
// discovery order for records with identical keys.
|
|
void sortDiagnostics(std::vector<Diagnostic>& diagnostics);
|
|
|
|
} // namespace fesa
|