载入中...
搜索中...
未找到
DnutDiagnostic.h
浏览该文件的文档.
1#pragma once
2
5#include "common/Export.h"
6
7#include <cstdint>
8#include <string>
9#include <vector>
10
11namespace eve::dnut {
12
14enum class DnutSeverity : std::uint8_t { Warning, Error };
15
25 std::string path;
27 int line = 0;
29 int column = 0;
31 std::string message;
32
34 bool operator==(const DnutDiagnostic&) const = default;
35};
36
43[[nodiscard]] EVENGINE_API_PLATFORM bool hasErrors(const std::vector<DnutDiagnostic>& diagnostics);
44
45} // namespace eve::dnut
#define EVENGINE_API_PLATFORM
Definition Export.h:107
EVENGINE_API_PLATFORM bool hasErrors(const std::vector< DnutDiagnostic > &diagnostics)
Return whether any diagnostic is an error.
DnutSeverity
Severity of one .dnut source diagnostic.
One structured diagnostic anchored to a .dnut source location.
std::string message
Human-readable explanation; never used for program decisions.
std::string path
Source path supplied by the caller; never invented by the frontend.
int line
One-based source line, or zero for a document-level diagnostic.
int column
One-based source column, or zero when unknown.
bool operator==(const DnutDiagnostic &) const =default
Operator ==.