hoshi-lang
dev
Yet another programming language
Loading...
Searching...
No Matches
diagnostic.h
Go to the documentation of this file.
1
//
2
// Created for hoshi-lang LSP readiness refactoring.
3
//
4
5
#ifndef HOSHI_LANG_DIAGNOSTIC_H
6
#define HOSHI_LANG_DIAGNOSTIC_H
7
8
#include <cstdint>
9
#include <string>
10
#include <
share/def.hpp
>
11
12
namespace
yoi
{
13
14
enum class
DiagnosticSeverity
{
15
Error
,
16
Warning
,
17
Note
,
18
Hint
19
};
20
21
enum class
DiagnosticCategory
{
22
Generic
,
23
Syntax
,
24
Semantic
,
25
Internal
,
26
UCRTNotFound
,
27
ElysiaRuntimeNotFound
,
28
ModuleNotModified
,
29
NullableValue
30
};
31
32
struct
Diagnostic
{
33
yoi::wstr
sourceFile
;
34
yoi::indexT
line
;
// 1-based, for display and LSP
35
yoi::indexT
column
;
// 1-based, for display and LSP
36
std::string
message
;
37
DiagnosticSeverity
severity
;
38
DiagnosticCategory
category
;
39
40
Diagnostic
() =
default
;
41
42
Diagnostic
(
yoi::wstr
file,
yoi::indexT
line
,
yoi::indexT
col,
43
std::string msg,
44
DiagnosticSeverity
sev =
DiagnosticSeverity::Error
,
45
DiagnosticCategory
cat =
DiagnosticCategory::Generic
)
46
:
sourceFile
(
std
::move(file))
47
,
line
(
line
)
48
,
column
(col)
49
,
message
(
std
::move(msg))
50
,
severity
(sev)
51
,
category
(cat) {}
52
};
53
54
}
// namespace yoi
55
56
#endif
// HOSHI_LANG_DIAGNOSTIC_H
def.hpp
std
Definition
json.hpp:5639
yoi
Definition
builtinModule.cpp:7
yoi::DiagnosticCategory
DiagnosticCategory
Definition
diagnostic.h:21
yoi::DiagnosticCategory::ElysiaRuntimeNotFound
@ ElysiaRuntimeNotFound
yoi::DiagnosticCategory::NullableValue
@ NullableValue
yoi::DiagnosticCategory::UCRTNotFound
@ UCRTNotFound
yoi::DiagnosticCategory::ModuleNotModified
@ ModuleNotModified
yoi::DiagnosticCategory::Generic
@ Generic
yoi::DiagnosticCategory::Syntax
@ Syntax
yoi::DiagnosticCategory::Internal
@ Internal
yoi::DiagnosticCategory::Semantic
@ Semantic
yoi::DiagnosticSeverity
DiagnosticSeverity
Definition
diagnostic.h:14
yoi::DiagnosticSeverity::Warning
@ Warning
yoi::DiagnosticSeverity::Note
@ Note
yoi::DiagnosticSeverity::Error
@ Error
yoi::DiagnosticSeverity::Hint
@ Hint
yoi::wstr
std::wstring wstr
Definition
def.hpp:51
yoi::indexT
uint64_t indexT
Definition
def.hpp:54
yoi::Diagnostic
Definition
diagnostic.h:32
yoi::Diagnostic::message
std::string message
Definition
diagnostic.h:36
yoi::Diagnostic::Diagnostic
Diagnostic()=default
yoi::Diagnostic::severity
DiagnosticSeverity severity
Definition
diagnostic.h:37
yoi::Diagnostic::column
yoi::indexT column
Definition
diagnostic.h:35
yoi::Diagnostic::Diagnostic
Diagnostic(yoi::wstr file, yoi::indexT line, yoi::indexT col, std::string msg, DiagnosticSeverity sev=DiagnosticSeverity::Error, DiagnosticCategory cat=DiagnosticCategory::Generic)
Definition
diagnostic.h:42
yoi::Diagnostic::line
yoi::indexT line
Definition
diagnostic.h:34
yoi::Diagnostic::category
DiagnosticCategory category
Definition
diagnostic.h:38
yoi::Diagnostic::sourceFile
yoi::wstr sourceFile
Definition
diagnostic.h:33
compiler
diagnostics
diagnostic.h
Generated by
1.9.8